* [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
* Re: [IPV4] Always set hoplimit
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
0 siblings, 1 reply; 4+ messages in thread
From: David S. Miller @ 2003-11-19 0:59 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
On Thu, 13 Nov 2003 22:04:38 +1100
Herbert Xu <herbert@gondor.apana.org.au> wrote:
> 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?
I don't believe I changed this behavior intentionally. Let me
look into the revision history to verify that. I'm likely going
to apply your fix tonight, thanks.
Although it is an interesting question because both broadcasts and
locally destined packets have no reason to make it past the local
subnet and thus have their TTL/HOPLIMIT decremented or tested. I
therefore cannot imagine a case where the current behavior would cause
a problem.
Did you run into an actual problem that led you to this issue? If
so, what was it? Or was this just determined by pure code review?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [IPV4] Always set hoplimit
2003-11-19 1:08 ` Herbert Xu
@ 2003-11-19 1:05 ` David S. Miller
0 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2003-11-19 1:05 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
On Wed, 19 Nov 2003 12:08:27 +1100
Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Tue, Nov 18, 2003 at 04:59:09PM -0800, David S. Miller wrote:
> >
> > Did you run into an actual problem that led you to this issue? If
> > so, what was it? Or was this just determined by pure code review?
>
> Someone reported this problem to me after a picky firewall complained
> about getting broadcast packets with ttl == 0.
Ok, that doubly-justifies the fix.
Thanks again Herbert.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [IPV4] Always set hoplimit
2003-11-19 0:59 ` David S. Miller
@ 2003-11-19 1:08 ` Herbert Xu
2003-11-19 1:05 ` David S. Miller
0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2003-11-19 1:08 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
On Tue, Nov 18, 2003 at 04:59:09PM -0800, David S. Miller wrote:
>
> Did you run into an actual problem that led you to this issue? If
> so, what was it? Or was this just determined by pure code review?
Someone reported this problem to me after a picky firewall complained
about getting broadcast packets with ttl == 0.
Cheers,
--
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
^ 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).