From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-Id: <20130326173601.140156860@goodmis.org> Date: Tue, 26 Mar 2013 13:21:07 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: nitin padalia , Eric Dumazet , "David S. Miller" , Cong Wang , Eric Dumazet Subject: [PATCH 08/86] net: prevent setting ttl=0 via IP_TTL References: <20130326172059.136127374@goodmis.org> Content-Disposition: inline; filename=0008-net-prevent-setting-ttl-0-via-IP_TTL.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.6.11.1 stable review patch. If anyone has any objections, please let me know. ------------------ From: Cong Wang [ Upstream commit c9be4a5c49cf51cc70a993f004c5bb30067a65ce ] A regression is introduced by the following commit: commit 4d52cfbef6266092d535237ba5a4b981458ab171 Author: Eric Dumazet Date: Tue Jun 2 00:42:16 2009 -0700 net: ipv4/ip_sockglue.c cleanups Pure cleanups but it is not a pure cleanup... - if (val != -1 && (val < 1 || val>255)) + if (val != -1 && (val < 0 || val > 255)) Since there is no reason provided to allow ttl=0, change it back. Reported-by: nitin padalia Cc: nitin padalia Cc: Eric Dumazet Cc: David S. Miller Signed-off-by: Cong Wang Acked-by: Eric Dumazet Signed-off-by: David S. Miller --- net/ipv4/ip_sockglue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 14bbfcf..e95d72b 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -590,7 +590,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, case IP_TTL: if (optlen < 1) goto e_inval; - if (val != -1 && (val < 0 || val > 255)) + if (val != -1 && (val < 1 || val > 255)) goto e_inval; inet->uc_ttl = val; break; -- 1.7.10.4