From: Eric Dumazet <dada1@cosmosbay.com>
To: David Miller <davem@davemloft.net>
Cc: nicolas.dichtel@dev.6wind.com, netdev@vger.kernel.org
Subject: Re: [PATCH] ipv4/ipv6: check hop limit field on input
Date: Tue, 02 Jun 2009 07:31:12 +0200 [thread overview]
Message-ID: <4A24B920.2010605@cosmosbay.com> (raw)
In-Reply-To: <20090601.190430.80366622.davem@davemloft.net>
David Miller a écrit :
> From: Nicolas Dichtel <nicolas.dichtel@dev.6wind.com>
> Date: Mon, 01 Jun 2009 17:13:43 +0200
>
>> RFC indicates that a router must drop the packet if this field is 0.
>
> It only must do this when executing the forwarding function. It's an
> egress check, not an ingress one.
>
> I'm not applying this patch, it can even break some applications
> out there that use a TTL of zero intentionally to keep traffic
> only on a local subnet.
I wonder if we then should allow setting ttl to zero. I had to patch
my kernel to allow ping to do this...
I'll check RFC when time permits.
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index e2d1f87..efe2797 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -558,7 +558,7 @@ static int do_ip_setsockopt(struct sock *sk, int level,
case IP_TTL:
if (optlen<1)
goto e_inval;
- if (val != -1 && (val < 1 || val>255))
+ if (val != -1 && (val < 0 || val>255))
goto e_inval;
inet->uc_ttl = val;
break;
next prev parent reply other threads:[~2009-06-02 5:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-01 15:13 [PATCH] ipv4/ipv6: check hop limit field on input Nicolas Dichtel
2009-06-01 16:19 ` Florian Westphal
2009-06-01 16:49 ` Nicolas Dichtel
2009-06-01 17:13 ` Florian Westphal
2009-06-02 9:30 ` Nicolas Dichtel
2009-06-01 18:43 ` Eric Dumazet
2009-06-01 18:55 ` Brian Haley
2009-06-02 1:54 ` John Dykstra
2009-06-02 2:02 ` David Miller
2009-06-02 9:22 ` John Dykstra
2009-06-02 9:32 ` David Miller
2009-06-02 9:35 ` Nicolas Dichtel
2009-06-02 9:30 ` Nicolas Dichtel
2009-06-02 9:30 ` Nicolas Dichtel
2009-06-02 2:04 ` David Miller
2009-06-02 5:31 ` Eric Dumazet [this message]
2009-06-02 5:43 ` David Miller
2009-06-02 9:36 ` Nicolas Dichtel
2009-06-02 9:37 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A24B920.2010605@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@dev.6wind.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).