Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netipsec Delint for compiling with INET6:
details: https://anonhg.NetBSD.org/src/rev/f4d381f41bc8
branches: trunk
changeset: 559547:f4d381f41bc8
user: jonathan <jonathan%NetBSD.org@localhost>
date: Sat Mar 20 03:08:55 2004 +0000
description:
Delint for compiling with INET6:
Add 'XXX FIXME' comments to ah4_ctlinput(), esp4_ctlinput()
ipcode-paths merely cast away local variables ip, ah/esp, sav; the
fast-ipsec IPv4 code appears to work even so.
In espv6_ctlinput(), call the fast-ipsec KEY_ALLOCSA()/KEY_FREESA()
macros, not the KAME-native key_allocsa()/key_freesa() functions.
Cast sa6_src/sa6_dst to void; the fast-ipsec API does not (yet) pass
both src and dst addrs to KEY_d-ALLOCSA/KEY_FREESA.
Make sure 'off' is set to 0 on the branch where it was formerly
used-before-set.
Will now compile with ``options INET6'' (as in
sys/arch/i386/conf/GENERIC.FAST_IPSEC), but is not yet
expected to acutally work with IPv6.
diffstat:
sys/netipsec/ipsec_netbsd.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diffs (67 lines):
diff -r a0f9e2380b21 -r f4d381f41bc8 sys/netipsec/ipsec_netbsd.c
--- a/sys/netipsec/ipsec_netbsd.c Sat Mar 20 02:58:47 2004 +0000
+++ b/sys/netipsec/ipsec_netbsd.c Sat Mar 20 03:08:55 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec_netbsd.c,v 1.6 2004/03/02 02:22:56 thorpej Exp $ */
+/* $NetBSD: ipsec_netbsd.c,v 1.7 2004/03/20 03:08:55 jonathan Exp $ */
/* $KAME: esp_input.c,v 1.60 2001/09/04 08:43:19 itojun Exp $ */
/* $KAME: ah_input.c,v 1.64 2001/09/04 08:43:19 itojun Exp $ */
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsec_netbsd.c,v 1.6 2004/03/02 02:22:56 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_netbsd.c,v 1.7 2004/03/20 03:08:55 jonathan Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -100,6 +100,7 @@
if ((unsigned)cmd >= PRC_NCMDS)
return NULL;
#ifndef notyet
+ /* jonathan%netbsd.org@localhost: XXX FIXME */
(void) ip; (void) ah; (void) icp; (void) sav;
#else
if (cmd == PRC_MSGSIZE && ip_mtudisc && ip && ip->ip_v == 4) {
@@ -158,6 +159,7 @@
if ((unsigned)cmd >= PRC_NCMDS)
return NULL;
#ifndef notyet
+ /* jonathan%netbsd.org@localhost: XXX FIXME */
(void) ip; (void) esp; (void) icp; (void) sav;
#else
if (cmd == PRC_MSGSIZE && ip_mtudisc && ip && ip->ip_v == 4) {
@@ -229,6 +231,7 @@
} else {
m = NULL;
ip6 = NULL;
+ off = 0;
}
if (ip6) {
@@ -278,15 +281,23 @@
*/
sa6_src = ip6cp->ip6c_src;
sa6_dst = (struct sockaddr_in6 *)sa;
+#ifdef KAME
sav = key_allocsa(AF_INET6,
(caddr_t)&sa6_src->sin6_addr,
(caddr_t)&sa6_dst->sin6_addr,
IPPROTO_ESP, espp->esp_spi);
+#else
+ /* jonathan%netbsd.org@localhost: XXX FIXME */
+ (void)sa6_src; (void)sa6_dst;
+ sav = KEY_ALLOCSA((union sockaddr_union*)sa,
+ IPPROTO_ESP, espp->esp_spi);
+
+#endif
if (sav) {
if (sav->state == SADB_SASTATE_MATURE ||
sav->state == SADB_SASTATE_DYING)
valid++;
- key_freesav(sav);
+ KEY_FREESAV(&sav);
}
/* XXX Further validation? */
Home |
Main Index |
Thread Index |
Old Index