Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/netinet6 Pull up revision 1.15 (requested by itojun):



details:   https://anonhg.NetBSD.org/src/rev/2ae2ea06019a
branches:  netbsd-1-5
changeset: 491472:2ae2ea06019a
user:      he <he%NetBSD.org@localhost>
date:      Tue May 01 10:12:20 2001 +0000

description:
Pull up revision 1.15 (requested by itojun):
  Make it possible to turn off ingress filter on gif/stf tunnel
  egress by using IFF_LINK2.  Fixes (part of) PR#11163.

diffstat:

 sys/netinet6/in6_gif.c |  21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diffs (49 lines):

diff -r 76a2001d0c7e -r 2ae2ea06019a sys/netinet6/in6_gif.c
--- a/sys/netinet6/in6_gif.c    Tue May 01 10:11:48 2001 +0000
+++ b/sys/netinet6/in6_gif.c    Tue May 01 10:12:20 2001 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: in6_gif.c,v 1.14 2000/04/19 06:30:56 itojun Exp $      */
-/*     $KAME: in6_gif.c,v 1.34 2000/04/19 04:51:58 itojun Exp $        */
+/*     $NetBSD: in6_gif.c,v 1.14.4.1 2001/05/01 10:12:20 he Exp $      */
+/*     $KAME: in6_gif.c,v 1.43 2001/01/22 07:27:17 itojun Exp $        */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -47,6 +47,8 @@
 #if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
 #include <sys/ioctl.h>
 #endif
+#include <sys/queue.h>
+#include <sys/syslog.h>
 
 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
 #include <sys/malloc.h>
@@ -336,7 +338,8 @@
        /* martian filters on outer source - done in ip6_input */
 
        /* ingress filters on outer source */
-       if ((m->m_flags & M_PKTHDR) != 0 && m->m_pkthdr.rcvif) {
+       if ((sc->gif_if.if_flags & IFF_LINK2) == 0 &&
+           (m->m_flags & M_PKTHDR) != 0 && m->m_pkthdr.rcvif) {
                struct sockaddr_in6 sin6;
                struct rtentry *rt;
 
@@ -350,10 +353,14 @@
 #else
                rt = rtalloc1((struct sockaddr *)&sin6, 0);
 #endif
-               if (!rt)
-                       return 0;
-               if (rt->rt_ifp != m->m_pkthdr.rcvif) {
-                       rtfree(rt);
+               if (!rt || rt->rt_ifp != m->m_pkthdr.rcvif) {
+#if 0
+                       log(LOG_WARNING, "%s: packet from %s dropped "
+                           "due to ingress filter\n", if_name(&sc->gif_if),
+                           ip6_sprintf(&sin6.sin6_addr));
+#endif
+                       if (rt)
+                               rtfree(rt);
                        return 0;
                }
                rtfree(rt);



Home | Main Index | Thread Index | Old Index