提交 91b2a3f9 编写于 作者: Y YOSHIFUJI Hideaki / 吉藤英明 提交者: David S. Miller

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: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e7db38c3
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册