projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ed2c891
)
net: prevent setting ttl=0 via IP_TTL
author
Cong Wang
<
[email protected]
>
Mon, 7 Jan 2013 21:17:00 +0000
(21:17 +0000)
committer
David S. Miller
<
[email protected]
>
Wed, 9 Jan 2013 01:57:10 +0000
(17:57 -0800)
A regression is introduced by the following commit:
commit
4d52cfbef6266092d535237ba5a4b981458ab171
Author: Eric Dumazet <
[email protected]
>
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 <
[email protected]
>
Cc: nitin padalia <
[email protected]
>
Cc: Eric Dumazet <
[email protected]
>
Cc: David S. Miller <
[email protected]
>
Signed-off-by: Cong Wang <
[email protected]
>
Acked-by: Eric Dumazet <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/ipv4/ip_sockglue.c
patch
|
blob
|
history
diff --git
a/net/ipv4/ip_sockglue.c
b/net/ipv4/ip_sockglue.c
index 3c9d20880283de0f9b5244eae8184e76d9a20dcd..d9c4f113d7093bba7eba2beefc31cd0af4b9bb95 100644
(file)
--- 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;