From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, yoshfuji@linux-ipv6.org
Subject: [RESEND PATCH net-next-2.6 3/3] ipv6 sit: Set relay to 0.0.0.0 directly if relay_prefixlen == 0.
Date: Sun, 11 Oct 2009 22:45:13 +0900 [thread overview]
Message-ID: <4AD1E169.6090705@linux-ipv6.org> (raw)
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>
---
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 193d0c6..510d31f 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;
next reply other threads:[~2009-10-11 13:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-11 13:45 YOSHIFUJI Hideaki [this message]
2009-10-12 7:32 ` [RESEND PATCH net-next-2.6 3/3] ipv6 sit: Set relay to 0.0.0.0 directly if relay_prefixlen == 0 Eric Dumazet
2009-10-12 8:18 ` David Miller
2009-10-12 9:03 ` YOSHIFUJI Hideaki
2009-10-12 8:50 ` YOSHIFUJI Hideaki
2009-10-12 9:08 ` David Miller
2009-10-12 9:08 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AD1E169.6090705@linux-ipv6.org \
--to=yoshfuji@linux-ipv6.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).