diff options
author | YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org> | 2009-10-11 05:45:13 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-12 08:41:10 +0200 |
commit | 91b2a3f9bb0fa8d64b365a10b0624b0341e1a338 (patch) | |
tree | 0152d7f1a7a38b74d6d55085fc34d01f86635e70 /net/ipv6/sit.c | |
parent | ipv6 sit: Fix 6rd relay address. (diff) | |
download | linux-91b2a3f9bb0fa8d64b365a10b0624b0341e1a338.tar.xz linux-91b2a3f9bb0fa8d64b365a10b0624b0341e1a338.zip |
ipv6 sit: Set relay to 0.0.0.0 directly if relay_prefixlen == 0.
ipv6 sit: Set relay to 0.0.0.0 directly if relay_prefixlen == 0.
Do not use bit-shift if relay_prefixlen == 0;
relay_prefix << 32 does not result in 0.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r-- | net/ipv6/sit.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 193d0c6c5ce2..510d31f3cb96 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -1014,9 +1014,12 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) ip6rd.prefixlen); if (!ipv6_addr_equal(&prefix, &ip6rd.prefix)) goto done; - relay_prefix = ip6rd.relay_prefix & - htonl(0xffffffffUL << - (32 - ip6rd.relay_prefixlen)); + if (ip6rd.relay_prefixlen) + relay_prefix = ip6rd.relay_prefix & + htonl(0xffffffffUL << + (32 - ip6rd.relay_prefixlen)); + else + relay_prefix = 0; if (relay_prefix != ip6rd.relay_prefix) goto done; |