ipv6: change ipv6_stub_impl.ipv6_dst_lookup to take net argument
This patch adds net argument to ipv6_stub_impl.ipv6_dst_lookup for use cases where sk is not available (like mpls). sk appears to be needed to get the namespace 'net' and is optional otherwise. This patch series changes ipv6_stub_impl.ipv6_dst_lookup to take net argument. sk remains optional. All callers of ipv6_stub_impl.ipv6_dst_lookup have been modified to pass net. I have modified them to use already available 'net' in the scope of the call. I can change them to sock_net(sk) to avoid any unintended change in behaviour if sock namespace is different. They dont seem to be from code inspection. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
d3aa45ce6b
commit
343d60aada
@@ -329,7 +329,7 @@ static struct dst_entry *icmpv6_route_lookup(struct net *net,
|
||||
struct flowi6 fl2;
|
||||
int err;
|
||||
|
||||
err = ip6_dst_lookup(sk, &dst, fl6);
|
||||
err = ip6_dst_lookup(net, sk, &dst, fl6);
|
||||
if (err)
|
||||
return ERR_PTR(err);
|
||||
|
||||
@@ -361,7 +361,7 @@ static struct dst_entry *icmpv6_route_lookup(struct net *net,
|
||||
if (err)
|
||||
goto relookup_failed;
|
||||
|
||||
err = ip6_dst_lookup(sk, &dst2, &fl2);
|
||||
err = ip6_dst_lookup(net, sk, &dst2, &fl2);
|
||||
if (err)
|
||||
goto relookup_failed;
|
||||
|
||||
@@ -591,7 +591,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
|
||||
else if (!fl6.flowi6_oif)
|
||||
fl6.flowi6_oif = np->ucast_oif;
|
||||
|
||||
err = ip6_dst_lookup(sk, &dst, &fl6);
|
||||
err = ip6_dst_lookup(net, sk, &dst, &fl6);
|
||||
if (err)
|
||||
goto out;
|
||||
dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), sk, 0);
|
||||
|
Reference in New Issue
Block a user