Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/net Pull up revision 1.26 (via patch, requested by ...



details:   https://anonhg.NetBSD.org/src/rev/8b545ac16920
branches:  netbsd-1-5
changeset: 492880:8b545ac16920
user:      he <he%NetBSD.org@localhost>
date:      Tue Feb 26 20:57:57 2002 +0000

description:
Pull up revision 1.26 (via patch, requested by martin):
  Clear M_BCAST and M_MCAST on encapsulated packets on outgoing
  mbufs.  Also do not copy TTL from the inner packet, and make the
  outer TTL sysctl'able.  Fixes PR#14269, and makes traceroute work
  over GRE tunnels.

diffstat:

 sys/net/if_gre.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (52 lines):

diff -r 4bd500df5a46 -r 8b545ac16920 sys/net/if_gre.c
--- a/sys/net/if_gre.c  Tue Feb 26 20:57:42 2002 +0000
+++ b/sys/net/if_gre.c  Tue Feb 26 20:57:57 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gre.c,v 1.9.6.3 2001/12/09 18:13:00 he Exp $ */
+/*     $NetBSD: if_gre.c,v 1.9.6.4 2002/02/26 20:57:57 he Exp $ */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -115,6 +115,7 @@
 #define LINK_MASK (IFF_LINK0|IFF_LINK1|IFF_LINK2)
 
 struct gre_softc gre_softc[NGRE];
+int ip_gre_ttl = GRE_TTL;
 
 
 int gre_compute_route(struct gre_softc *sc);
@@ -173,7 +174,7 @@
        struct gre_softc *sc = (struct gre_softc *)(ifp->if_softc);
        struct greip *gh;
        struct ip *inp;
-       u_char ttl, osrc;
+       u_char osrc;
        u_short etype = 0;
        
        if ((ifp->if_flags & IFF_UP) == 0)
@@ -198,7 +199,7 @@
        }
 #endif
 
-       ttl = 255;
+       m->m_flags &= ~(M_BCAST|M_MCAST);
 
        if (sc->g_proto == IPPROTO_MOBILE) {
                if (dst->sa_family == AF_INET) {
@@ -265,7 +266,6 @@
                switch(dst->sa_family) {
                case AF_INET:
                        inp = mtod(m, struct ip *);
-                       ttl = inp->ip_ttl;
                        etype = ETHERTYPE_IP;
                        break;
 #ifdef NETATALK
@@ -310,7 +310,7 @@
                gh->gi_src = sc->g_src;
                gh->gi_dst = sc->g_dst;
                ((struct ip*)gh)->ip_hl = (sizeof(struct ip)) >> 2; 
-               ((struct ip*)gh)->ip_ttl = ttl;
+               ((struct ip*)gh)->ip_ttl = ip_gre_ttl;
                ((struct ip*)gh)->ip_tos = inp->ip_tos;
            gh->gi_len = m->m_pkthdr.len;
        }



Home | Main Index | Thread Index | Old Index