summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLi Wei <lw@cn.fujitsu.com>2011-11-27 22:33:34 +0100
committerDavid S. Miller <davem@davemloft.net>2011-11-29 00:09:13 +0100
commit2a38e6d5aed24bb7f0211e0819fac8c32c2b5791 (patch)
tree8b31067a05b221efa900bb333aa58c7fbaffc854 /net
parentnet: Fix corruption in /proc/*/net/dev_mcast (diff)
downloadlinux-2a38e6d5aed24bb7f0211e0819fac8c32c2b5791.tar.xz
linux-2a38e6d5aed24bb7f0211e0819fac8c32c2b5791.zip
ipv6: Set mcast_hops to IPV6_DEFAULT_MCASTHOPS when -1 was given.
We need to set np->mcast_hops to it's default value at this moment otherwise when we use it and found it's value is -1, the logic to get default hop limit doesn't take multicast into account and will return wrong hop limit(IPV6_DEFAULT_HOPLIMIT) which is for unicast. Signed-off-by: Li Wei <lw@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/ipv6_sockglue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index c99e3ee9781f..26cb08c84b74 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -503,7 +503,7 @@ done:
goto e_inval;
if (val > 255 || val < -1)
goto e_inval;
- np->mcast_hops = val;
+ np->mcast_hops = (val == -1 ? IPV6_DEFAULT_MCASTHOPS : val);
retv = 0;
break;