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.
This commit is contained in:
jonathan 2004-03-20 03:08:55 +00:00
parent a04b44616a
commit 5093b79faa
1 changed files with 14 additions and 3 deletions

View File

@ -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 @@ ah4_ctlinput(cmd, sa, v)
if ((unsigned)cmd >= PRC_NCMDS)
return NULL;
#ifndef notyet
/* jonathan@netbsd.org: 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 @@ esp4_ctlinput(cmd, sa, v)
if ((unsigned)cmd >= PRC_NCMDS)
return NULL;
#ifndef notyet
/* jonathan@netbsd.org: 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 @@ esp6_ctlinput(cmd, sa, d)
} else {
m = NULL;
ip6 = NULL;
off = 0;
}
if (ip6) {
@ -278,15 +281,23 @@ esp6_ctlinput(cmd, sa, d)
*/
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: 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? */