aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
index 02dcafdc7a95..e5f6cf7e0d8c 100644
--- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
@@ -334,9 +334,14 @@ ipv6_getorigdst(struct sock *sk, int optval, void __user *user, int *len)
334 memcpy(&sin6.sin6_addr, 334 memcpy(&sin6.sin6_addr,
335 &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.in6, 335 &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.in6,
336 sizeof(sin6.sin6_addr)); 336 sizeof(sin6.sin6_addr));
337 sin6.sin6_scope_id = sk->sk_bound_dev_if;
338 337
339 nf_ct_put(ct); 338 nf_ct_put(ct);
339
340 if (ipv6_addr_type(&sin6.sin6_addr) & IPV6_ADDR_LINKLOCAL)
341 sin6.sin6_scope_id = sk->sk_bound_dev_if;
342 else
343 sin6.sin6_scope_id = 0;
344
340 return copy_to_user(user, &sin6, sizeof(sin6)) ? -EFAULT : 0; 345 return copy_to_user(user, &sin6, sizeof(sin6)) ? -EFAULT : 0;
341} 346}
342 347