netns: Add network namespace argument to rt6_fill_node() and ipv6_dev_get_saddr()
ipv6_dev_get_saddr() blindly de-references dst_dev to get the network namespace, but some callers might pass NULL. Change callers to pass a namespace pointer instead. Signed-off-by: Brian Haley <brian.haley@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
0eb8b1fe92
commit
191cd58250
@@ -52,12 +52,14 @@ static struct dst_entry *xfrm6_dst_lookup(int tos, xfrm_address_t *saddr,
|
||||
static int xfrm6_get_saddr(xfrm_address_t *saddr, xfrm_address_t *daddr)
|
||||
{
|
||||
struct dst_entry *dst;
|
||||
struct net_device *dev;
|
||||
|
||||
dst = xfrm6_dst_lookup(0, NULL, daddr);
|
||||
if (IS_ERR(dst))
|
||||
return -EHOSTUNREACH;
|
||||
|
||||
ipv6_dev_get_saddr(ip6_dst_idev(dst)->dev,
|
||||
dev = ip6_dst_idev(dst)->dev;
|
||||
ipv6_dev_get_saddr(dev_net(dev), dev,
|
||||
(struct in6_addr *)&daddr->a6, 0,
|
||||
(struct in6_addr *)&saddr->a6);
|
||||
dst_release(dst);
|
||||
|
Reference in New Issue
Block a user