netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [IPV4] Always set hoplimit
@ 2003-11-13 11:04 Herbert Xu
  2003-11-19  0:59 ` David S. Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2003-11-13 11:04 UTC (permalink / raw)
  To: davem, netdev

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

Hi Dave:

Is there any reason why local/broadcast packets should have a ttl of zero?
This is the result of the HOPLIMIT change as those packets doesn't get
their HOPLIMIT set.  This patch sets it for them.

Am I missing something?
-- 
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: p --]
[-- Type: text/plain, Size: 1120 bytes --]

Index: kernel-source-2.4/net/ipv4/route.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.4/net/ipv4/route.c,v
retrieving revision 1.6
diff -u -r1.6 route.c
--- kernel-source-2.4/net/ipv4/route.c	3 Sep 2003 10:27:21 -0000	1.6
+++ kernel-source-2.4/net/ipv4/route.c	13 Nov 2003 10:58:04 -0000
@@ -1275,9 +1275,6 @@
 			rt->rt_gateway = FIB_RES_GW(*res);
 		memcpy(rt->u.dst.metrics, fi->fib_metrics,
 		       sizeof(rt->u.dst.metrics));
-		if (rt->u.dst.metrics[RTAX_HOPLIMIT-1] == 0)
-			rt->u.dst.metrics[RTAX_HOPLIMIT-1] =
-				sysctl_ip_default_ttl;
 		if (fi->fib_mtu == 0) {
 			rt->u.dst.metrics[RTAX_MTU-1] = rt->u.dst.dev->mtu;
 			if (rt->u.dst.metrics[RTAX_LOCK-1] & (1 << RTAX_MTU) &&
@@ -1291,6 +1288,8 @@
 	} else
 		rt->u.dst.metrics[RTAX_MTU-1]= rt->u.dst.dev->mtu;
 
+	if (rt->u.dst.metrics[RTAX_HOPLIMIT-1] == 0)
+		rt->u.dst.metrics[RTAX_HOPLIMIT-1] = sysctl_ip_default_ttl;
 	if (rt->u.dst.metrics[RTAX_MTU-1] > IP_MAX_MTU)
 		rt->u.dst.metrics[RTAX_MTU-1] = IP_MAX_MTU;
 	if (rt->u.dst.metrics[RTAX_ADVMSS-1] == 0)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-11-19  1:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-13 11:04 [IPV4] Always set hoplimit Herbert Xu
2003-11-19  0:59 ` David S. Miller
2003-11-19  1:08   ` Herbert Xu
2003-11-19  1:05     ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).