netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: pablo@netfilter.org
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 04/12] netfilter: nf_ct_ipv6: use ipv6_iface_scope_id in conntrack to return scope id
Date: Mon, 25 Mar 2013 13:15:44 +0100	[thread overview]
Message-ID: <1364213752-3934-5-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1364213752-3934-1-git-send-email-pablo@netfilter.org>

From: Hannes Frederic Sowa <hannes@stressinduktion.org>

As in (842df07 ipv6: use newly introduced __ipv6_addr_needs_scope_id and
ipv6_iface_scope_id).

Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
index 2b6c226..97bcf2b 100644
--- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
@@ -330,12 +330,8 @@ ipv6_getorigdst(struct sock *sk, int optval, void __user *user, int *len)
 					sizeof(sin6.sin6_addr));
 
 	nf_ct_put(ct);
-
-	if (ipv6_addr_type(&sin6.sin6_addr) & IPV6_ADDR_LINKLOCAL)
-		sin6.sin6_scope_id = sk->sk_bound_dev_if;
-	else
-		sin6.sin6_scope_id = 0;
-
+	sin6.sin6_scope_id = ipv6_iface_scope_id(&sin6.sin6_addr,
+						 sk->sk_bound_dev_if);
 	return copy_to_user(user, &sin6, sizeof(sin6)) ? -EFAULT : 0;
 }
 
-- 
1.7.10.4

  parent reply	other threads:[~2013-03-25 12:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25 12:15 [PATCH 00/12] Netfilter updates for net-next pablo
2013-03-25 12:15 ` [PATCH 01/12] netfilter: ip6t_NPT: Use csum_partial() pablo
2013-03-25 12:15 ` [PATCH 02/12] ipv4: netfilter: use PTR_RET instead of IS_ERR + PTR_ERR pablo
2013-03-25 12:15 ` [PATCH 03/12] bridge: " pablo
2013-03-25 12:15 ` pablo [this message]
2013-03-25 12:15 ` [PATCH 05/12] netfilter: ebt_ulog: remove unnecessary spin lock protection pablo
2013-03-25 12:15 ` [PATCH 06/12] netfilter: nfnetlink_queue: use xor hash function to distribute instances pablo
2013-03-25 12:15 ` [PATCH 07/12] ipvs: fix hashing in ip_vs_svc_hashkey pablo
2013-03-25 12:15 ` [PATCH 08/12] ipvs: fix some sparse warnings pablo
2013-03-25 12:15 ` [PATCH 09/12] netfilter: ctnetlink: allow to dump expectation per master conntrack pablo
2013-03-25 12:15 ` [PATCH 10/12] netfilter: nfnetlink_queue: zero copy support pablo
2013-03-25 12:15 ` [PATCH 11/12] netfilter: nf_conntrack: add include to fix sparse warning pablo
2013-03-25 12:15 ` [PATCH 12/12] netfilter: nf_conntrack: speed up module removal path if netns in use pablo
2013-03-25 16:13 ` [PATCH 00/12] Netfilter updates for net-next 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=1364213752-3934-5-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@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).