Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys gif(4), ipsec(4) and l2tp(4) use encap_attach_addr().
details: https://anonhg.NetBSD.org/src/rev/a9c566161c5d
branches: trunk
changeset: 372552:a9c566161c5d
user: knakahara <knakahara%NetBSD.org@localhost>
date: Wed Dec 07 08:30:15 2022 +0000
description:
gif(4), ipsec(4) and l2tp(4) use encap_attach_addr().
diffstat:
sys/netinet/in_gif.c | 14 +++++++-------
sys/netinet/in_l2tp.c | 9 +++++----
sys/netinet6/in6_gif.c | 14 +++++++-------
sys/netinet6/in6_l2tp.c | 9 +++++----
sys/netipsec/ipsecif.c | 15 +++++++++------
5 files changed, 33 insertions(+), 28 deletions(-)
diffs (175 lines):
diff -r c741d8c612e1 -r a9c566161c5d sys/netinet/in_gif.c
--- a/sys/netinet/in_gif.c Wed Dec 07 08:28:46 2022 +0000
+++ b/sys/netinet/in_gif.c Wed Dec 07 08:30:15 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_gif.c,v 1.95 2019/09/19 06:07:25 knakahara Exp $ */
+/* $NetBSD: in_gif.c,v 1.96 2022/12/07 08:30:15 knakahara Exp $ */
/* $KAME: in_gif.c,v 1.66 2001/07/29 04:46:09 itojun Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.95 2019/09/19 06:07:25 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.96 2022/12/07 08:30:15 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -369,12 +369,12 @@
if (!var->gv_psrc || !var->gv_pdst)
return EINVAL;
- var->gv_encap_cookie4 = encap_attach(AF_INET, -1, var->gv_psrc,
- (struct sockaddr *)&mask4, var->gv_pdst, (struct sockaddr *)&mask4,
- &in_gif_encapsw, var->gv_softc);
+
+ var->gv_encap_cookie4 = encap_attach_addr(AF_INET, -1, var->gv_psrc,
+ var->gv_pdst, NULL, &in_gif_encapsw, var->gv_softc);
#else
- var->gv_encap_cookie4 = encap_attach_func(AF_INET, -1, gif_encapcheck,
- &in_gif_encapsw, var->gv_softc);
+ var->gv_encap_cookie4 = encap_attach_addr(AF_INET, -1, var->gv_psrc,
+ var->gv_pdst, gif_encapcheck, &in_gif_encapsw, var->gv_softc);
#endif
if (var->gv_encap_cookie4 == NULL)
return EEXIST;
diff -r c741d8c612e1 -r a9c566161c5d sys/netinet/in_l2tp.c
--- a/sys/netinet/in_l2tp.c Wed Dec 07 08:28:46 2022 +0000
+++ b/sys/netinet/in_l2tp.c Wed Dec 07 08:30:15 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_l2tp.c,v 1.20 2021/02/19 14:51:59 christos Exp $ */
+/* $NetBSD: in_l2tp.c,v 1.21 2022/12/07 08:30:15 knakahara Exp $ */
/*
* Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_l2tp.c,v 1.20 2021/02/19 14:51:59 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_l2tp.c,v 1.21 2022/12/07 08:30:15 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_l2tp.h"
@@ -404,8 +404,9 @@
if (sc == NULL)
return EINVAL;
- var->lv_encap_cookie = encap_attach_func(AF_INET, IPPROTO_L2TP,
- in_l2tp_match, &in_l2tp_encapsw, sc);
+
+ var->lv_encap_cookie = encap_attach_addr(AF_INET, IPPROTO_L2TP,
+ var->lv_psrc, var->lv_pdst, in_l2tp_match, &in_l2tp_encapsw, sc);
if (var->lv_encap_cookie == NULL)
return EEXIST;
diff -r c741d8c612e1 -r a9c566161c5d sys/netinet6/in6_gif.c
--- a/sys/netinet6/in6_gif.c Wed Dec 07 08:28:46 2022 +0000
+++ b/sys/netinet6/in6_gif.c Wed Dec 07 08:30:15 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_gif.c,v 1.95 2019/10/30 03:45:59 knakahara Exp $ */
+/* $NetBSD: in6_gif.c,v 1.96 2022/12/07 08:30:15 knakahara Exp $ */
/* $KAME: in6_gif.c,v 1.62 2001/07/29 04:27:25 itojun Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.95 2019/10/30 03:45:59 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.96 2022/12/07 08:30:15 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -433,12 +433,12 @@
if (!var->gv_psrc || !var->gv_pdst)
return EINVAL;
- var->gv_encap_cookie6 = encap_attach(AF_INET6, -1, var->gv_psrc,
- sin6tosa(&mask6), var->gv_pdst, sin6tosa(&mask6),
- (const void *)&in6_gif_encapsw, var->gv_softc);
+
+ var->gv_encap_cookie6 = encap_attach_addr(AF_INET6, -1, var->gv_psrc,
+ var->gv_pdst, NULL, &in6_gif_encapsw, var->gv_softc);
#else
- var->gv_encap_cookie6 = encap_attach_func(AF_INET6, -1, gif_encapcheck,
- &in6_gif_encapsw, var->gv_softc);
+ var->gv_encap_cookie6 = encap_attach_addr(AF_INET6, -1, var->gv_psrc,
+ var->gv_pdst, gif_encapcheck, &in6_gif_encapsw, var->gv_softc);
#endif
if (var->gv_encap_cookie6 == NULL)
return EEXIST;
diff -r c741d8c612e1 -r a9c566161c5d sys/netinet6/in6_l2tp.c
--- a/sys/netinet6/in6_l2tp.c Wed Dec 07 08:28:46 2022 +0000
+++ b/sys/netinet6/in6_l2tp.c Wed Dec 07 08:30:15 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_l2tp.c,v 1.21 2021/02/19 14:52:00 christos Exp $ */
+/* $NetBSD: in6_l2tp.c,v 1.22 2022/12/07 08:30:15 knakahara Exp $ */
/*
* Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_l2tp.c,v 1.21 2021/02/19 14:52:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_l2tp.c,v 1.22 2022/12/07 08:30:15 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_l2tp.h"
@@ -399,8 +399,9 @@
if (sc == NULL)
return EINVAL;
- var->lv_encap_cookie = encap_attach_func(AF_INET6, IPPROTO_L2TP,
- in6_l2tp_match, &in6_l2tp_encapsw, sc);
+
+ var->lv_encap_cookie = encap_attach_addr(AF_INET6, IPPROTO_L2TP,
+ var->lv_psrc, var->lv_pdst, in6_l2tp_match, &in6_l2tp_encapsw, sc);
if (var->lv_encap_cookie == NULL)
return EEXIST;
diff -r c741d8c612e1 -r a9c566161c5d sys/netipsec/ipsecif.c
--- a/sys/netipsec/ipsecif.c Wed Dec 07 08:28:46 2022 +0000
+++ b/sys/netipsec/ipsecif.c Wed Dec 07 08:30:15 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsecif.c,v 1.19 2020/01/31 06:54:19 knakahara Exp $ */
+/* $NetBSD: ipsecif.c,v 1.20 2022/12/07 08:30:15 knakahara Exp $ */
/*
* Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsecif.c,v 1.19 2020/01/31 06:54:19 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsecif.c,v 1.20 2022/12/07 08:30:15 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -937,8 +937,10 @@
if (var->iv_encap_cookie4 != NULL)
return EALREADY;
- var->iv_encap_cookie4 = encap_attach_func(AF_INET, -1, if_ipsec_encap_func,
- &ipsecif4_encapsw, sc);
+
+ var->iv_encap_cookie4 = encap_attach_addr(AF_INET, -1,
+ var->iv_psrc, var->iv_pdst, if_ipsec_encap_func, &ipsecif4_encapsw,
+ sc);
if (var->iv_encap_cookie4 == NULL)
return EEXIST;
@@ -971,8 +973,9 @@
KASSERT(if_ipsec_variant_is_configured(var));
KASSERT(var->iv_encap_cookie6 == NULL);
- var->iv_encap_cookie6 = encap_attach_func(AF_INET6, -1, if_ipsec_encap_func,
- &ipsecif6_encapsw, sc);
+ var->iv_encap_cookie6 = encap_attach_addr(AF_INET6, -1,
+ var->iv_psrc, var->iv_pdst, if_ipsec_encap_func, &ipsecif6_encapsw,
+ sc);
if (var->iv_encap_cookie6 == NULL)
return EEXIST;
Home |
Main Index |
Thread Index |
Old Index