Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/sys/netinet6 Pull up revision 1.83 (requested by itojun...



details:   https://anonhg.NetBSD.org/src/rev/a1dc039022b0
branches:  netbsd-1-6
changeset: 530767:a1dc039022b0
user:      tron <tron%NetBSD.org@localhost>
date:      Thu Oct 02 09:23:21 2003 +0000

description:
Pull up revision 1.83 (requested by itojun in ticket #1497):
handle link-local address in ipsec6_tunnel_validate().  from iij seli team

diffstat:

 sys/netinet6/ipsec.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (38 lines):

diff -r 68c787a350ac -r a1dc039022b0 sys/netinet6/ipsec.c
--- a/sys/netinet6/ipsec.c      Thu Oct 02 09:20:16 2003 +0000
+++ b/sys/netinet6/ipsec.c      Thu Oct 02 09:23:21 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipsec.c,v 1.47.2.2 2002/07/23 07:59:45 lukem Exp $     */
+/*     $NetBSD: ipsec.c,v 1.47.2.3 2003/10/02 09:23:21 tron Exp $      */
 /*     $KAME: ipsec.c,v 1.136 2002/05/19 00:36:39 itojun Exp $ */
 
 /*
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.47.2.2 2002/07/23 07:59:45 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.47.2.3 2003/10/02 09:23:21 tron Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -3373,6 +3373,7 @@
 {
        u_int8_t nxt = nxt0 & 0xff;
        struct sockaddr_in6 *sin6;
+       struct in6_addr in6;
 
        if (nxt != IPPROTO_IPV6)
                return 0;
@@ -3382,7 +3383,10 @@
        switch (((struct sockaddr *)&sav->sah->saidx.dst)->sa_family) {
        case AF_INET6:
                sin6 = ((struct sockaddr_in6 *)&sav->sah->saidx.dst);
-               if (!IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &sin6->sin6_addr))
+               in6 = sin6->sin6_addr;
+               if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr))
+                       in6.s6_addr16[1] = htons(sin6->sin6_scope_id) & 0xffff;
+               if (!IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &in6))
                        return 0;
                break;
        case AF_INET:



Home | Main Index | Thread Index | Old Index