aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/sit.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 193d0c6c5ce..510d31f3cb9 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;