Commit 8a3edd80 authored by Daniel Lezcano's avatar Daniel Lezcano Committed by David S. Miller

[NETNS][IPV6] fix some missing namespace

This patch adds some missing namespace
Signed-off-by: default avatarDaniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent db8dac20
...@@ -404,6 +404,7 @@ int ip6_forward(struct sk_buff *skb) ...@@ -404,6 +404,7 @@ int ip6_forward(struct sk_buff *skb)
struct dst_entry *dst = skb->dst; struct dst_entry *dst = skb->dst;
struct ipv6hdr *hdr = ipv6_hdr(skb); struct ipv6hdr *hdr = ipv6_hdr(skb);
struct inet6_skb_parm *opt = IP6CB(skb); struct inet6_skb_parm *opt = IP6CB(skb);
struct net *net = dst->dev->nd_net;
if (ipv6_devconf.forwarding == 0) if (ipv6_devconf.forwarding == 0)
goto error; goto error;
...@@ -450,7 +451,7 @@ int ip6_forward(struct sk_buff *skb) ...@@ -450,7 +451,7 @@ int ip6_forward(struct sk_buff *skb)
/* XXX: idev->cnf.proxy_ndp? */ /* XXX: idev->cnf.proxy_ndp? */
if (ipv6_devconf.proxy_ndp && if (ipv6_devconf.proxy_ndp &&
pneigh_lookup(&nd_tbl, &init_net, &hdr->daddr, skb->dev, 0)) { pneigh_lookup(&nd_tbl, net, &hdr->daddr, skb->dev, 0)) {
int proxied = ip6_forward_proxy_check(skb); int proxied = ip6_forward_proxy_check(skb);
if (proxied > 0) if (proxied > 0)
return ip6_input(skb); return ip6_input(skb);
...@@ -911,9 +912,10 @@ static int ip6_dst_lookup_tail(struct sock *sk, ...@@ -911,9 +912,10 @@ static int ip6_dst_lookup_tail(struct sock *sk,
struct dst_entry **dst, struct flowi *fl) struct dst_entry **dst, struct flowi *fl)
{ {
int err; int err;
struct net *net = sk->sk_net;
if (*dst == NULL) if (*dst == NULL)
*dst = ip6_route_output(sk->sk_net, sk, fl); *dst = ip6_route_output(net, sk, fl);
if ((err = (*dst)->error)) if ((err = (*dst)->error))
goto out_err_release; goto out_err_release;
...@@ -939,7 +941,7 @@ static int ip6_dst_lookup_tail(struct sock *sk, ...@@ -939,7 +941,7 @@ static int ip6_dst_lookup_tail(struct sock *sk,
struct flowi fl_gw; struct flowi fl_gw;
int redirect; int redirect;
ifp = ipv6_get_ifaddr(&init_net, &fl->fl6_src, ifp = ipv6_get_ifaddr(net, &fl->fl6_src,
(*dst)->dev, 1); (*dst)->dev, 1);
redirect = (ifp && ifp->flags & IFA_F_OPTIMISTIC); redirect = (ifp && ifp->flags & IFA_F_OPTIMISTIC);
...@@ -954,7 +956,7 @@ static int ip6_dst_lookup_tail(struct sock *sk, ...@@ -954,7 +956,7 @@ static int ip6_dst_lookup_tail(struct sock *sk,
dst_release(*dst); dst_release(*dst);
memcpy(&fl_gw, fl, sizeof(struct flowi)); memcpy(&fl_gw, fl, sizeof(struct flowi));
memset(&fl_gw.fl6_dst, 0, sizeof(struct in6_addr)); memset(&fl_gw.fl6_dst, 0, sizeof(struct in6_addr));
*dst = ip6_route_output(sk->sk_net, sk, &fl_gw); *dst = ip6_route_output(net, sk, &fl_gw);
if ((err = (*dst)->error)) if ((err = (*dst)->error))
goto out_err_release; goto out_err_release;
} }
......
...@@ -107,6 +107,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, ...@@ -107,6 +107,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, int optlen) char __user *optval, int optlen)
{ {
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct net *net = sk->sk_net;
int val, valbool; int val, valbool;
int retv = -ENOPROTOOPT; int retv = -ENOPROTOOPT;
...@@ -432,7 +433,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, ...@@ -432,7 +433,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != val) if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != val)
goto e_inval; goto e_inval;
if (__dev_get_by_index(&init_net, val) == NULL) { if (__dev_get_by_index(net, val) == NULL) {
retv = -ENODEV; retv = -ENODEV;
break; break;
} }
......
...@@ -2261,7 +2261,7 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void ...@@ -2261,7 +2261,7 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr)); skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr));
rt = (struct rt6_info*) ip6_route_output(&init_net, NULL, &fl); rt = (struct rt6_info*) ip6_route_output(net, NULL, &fl);
skb->dst = &rt->u.dst; skb->dst = &rt->u.dst;
err = rt6_fill_node(skb, rt, &fl.fl6_dst, &fl.fl6_src, iif, err = rt6_fill_node(skb, rt, &fl.fl6_dst, &fl.fl6_src, iif,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment