All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <amwang@redhat.com>
To: netdev@vger.kernel.org
Cc: Lorenzo Colitti <lorenzo@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Cong Wang <amwang@redhat.com>
Subject: [Patch net-next 2/2] ping: use ipv6_iface_scope_id() to get scope id
Date: Mon,  3 Jun 2013 13:55:59 +0800	[thread overview]
Message-ID: <1370238959-32008-2-git-send-email-amwang@redhat.com> (raw)
In-Reply-To: <1370238959-32008-1-git-send-email-amwang@redhat.com>

From: Cong Wang <amwang@redhat.com>

If we don't need scope id, we should initialize it to zero.

Cc: Lorenzo Colitti <lorenzo@google.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
 net/ipv4/ping.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 8c92781..b1993b3 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -905,9 +905,8 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 		if (np->sndflow)
 			sin6->sin6_flowinfo = ip6_flowinfo(ip6);
 
-		if (__ipv6_addr_needs_scope_id(
-		    ipv6_addr_type(&sin6->sin6_addr)))
-			sin6->sin6_scope_id = IP6CB(skb)->iif;
+		sin6->sin6_scope_id = ipv6_iface_scope_id(&sin6->sin6_addr,
+							  IP6CB(skb)->iif);
 
 		if (inet6_sk(sk)->rxopt.all)
 			pingv6_ops.ip6_datagram_recv_ctl(sk, msg, skb);
-- 
1.7.7.6

  reply	other threads:[~2013-06-03  5:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03  5:55 [Patch net-next 1/2] ping: some cleanup for net/ipv4/ping.c Cong Wang
2013-06-03  5:55 ` Cong Wang [this message]
2013-06-03  7:59   ` [Patch net-next 2/2] ping: use ipv6_iface_scope_id() to get scope id Lorenzo Colitti
2013-06-03  8:16     ` Cong Wang
2013-06-03  5:59 ` [Patch net-next 1/2] ping: some cleanup for net/ipv4/ping.c Joe Perches
2013-06-03  6:05   ` Cong Wang
2013-06-03  7:02 ` Lorenzo Colitti
2013-06-03  7:13   ` Cong Wang
2013-06-03  7:17     ` Lorenzo Colitti
2013-06-03  7:24       ` 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=1370238959-32008-2-git-send-email-amwang@redhat.com \
    --to=amwang@redhat.com \
    --cc=davem@davemloft.net \
    --cc=lorenzo@google.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.