Skip to content

Commit

Permalink
ipv6 sit: Set relay to 0.0.0.0 directly if relay_prefixlen == 0.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
yoshfuji authored and davem330 committed Oct 12, 2009
1 parent e7db38c commit 91b2a3f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions net/ipv6/sit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 91b2a3f

Please sign in to comment.