diff options
-rw-r--r-- | net/ipv6/ip6_output.c | 10 | ||||
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 3 | ||||
-rw-r--r-- | net/ipv6/route.c | 2 |
3 files changed, 9 insertions, 6 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 937018529d18..98762fde2b65 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -404,6 +404,7 @@ int ip6_forward(struct sk_buff *skb) | |||
404 | struct dst_entry *dst = skb->dst; | 404 | struct dst_entry *dst = skb->dst; |
405 | struct ipv6hdr *hdr = ipv6_hdr(skb); | 405 | struct ipv6hdr *hdr = ipv6_hdr(skb); |
406 | struct inet6_skb_parm *opt = IP6CB(skb); | 406 | struct inet6_skb_parm *opt = IP6CB(skb); |
407 | struct net *net = dst->dev->nd_net; | ||
407 | 408 | ||
408 | if (ipv6_devconf.forwarding == 0) | 409 | if (ipv6_devconf.forwarding == 0) |
409 | goto error; | 410 | goto error; |
@@ -450,7 +451,7 @@ int ip6_forward(struct sk_buff *skb) | |||
450 | 451 | ||
451 | /* XXX: idev->cnf.proxy_ndp? */ | 452 | /* XXX: idev->cnf.proxy_ndp? */ |
452 | if (ipv6_devconf.proxy_ndp && | 453 | if (ipv6_devconf.proxy_ndp && |
453 | pneigh_lookup(&nd_tbl, &init_net, &hdr->daddr, skb->dev, 0)) { | 454 | pneigh_lookup(&nd_tbl, net, &hdr->daddr, skb->dev, 0)) { |
454 | int proxied = ip6_forward_proxy_check(skb); | 455 | int proxied = ip6_forward_proxy_check(skb); |
455 | if (proxied > 0) | 456 | if (proxied > 0) |
456 | return ip6_input(skb); | 457 | return ip6_input(skb); |
@@ -911,9 +912,10 @@ static int ip6_dst_lookup_tail(struct sock *sk, | |||
911 | struct dst_entry **dst, struct flowi *fl) | 912 | struct dst_entry **dst, struct flowi *fl) |
912 | { | 913 | { |
913 | int err; | 914 | int err; |
915 | struct net *net = sk->sk_net; | ||
914 | 916 | ||
915 | if (*dst == NULL) | 917 | if (*dst == NULL) |
916 | *dst = ip6_route_output(sk->sk_net, sk, fl); | 918 | *dst = ip6_route_output(net, sk, fl); |
917 | 919 | ||
918 | if ((err = (*dst)->error)) | 920 | if ((err = (*dst)->error)) |
919 | goto out_err_release; | 921 | goto out_err_release; |
@@ -939,7 +941,7 @@ static int ip6_dst_lookup_tail(struct sock *sk, | |||
939 | struct flowi fl_gw; | 941 | struct flowi fl_gw; |
940 | int redirect; | 942 | int redirect; |
941 | 943 | ||
942 | ifp = ipv6_get_ifaddr(&init_net, &fl->fl6_src, | 944 | ifp = ipv6_get_ifaddr(net, &fl->fl6_src, |
943 | (*dst)->dev, 1); | 945 | (*dst)->dev, 1); |
944 | 946 | ||
945 | redirect = (ifp && ifp->flags & IFA_F_OPTIMISTIC); | 947 | redirect = (ifp && ifp->flags & IFA_F_OPTIMISTIC); |
@@ -954,7 +956,7 @@ static int ip6_dst_lookup_tail(struct sock *sk, | |||
954 | dst_release(*dst); | 956 | dst_release(*dst); |
955 | memcpy(&fl_gw, fl, sizeof(struct flowi)); | 957 | memcpy(&fl_gw, fl, sizeof(struct flowi)); |
956 | memset(&fl_gw.fl6_dst, 0, sizeof(struct in6_addr)); | 958 | memset(&fl_gw.fl6_dst, 0, sizeof(struct in6_addr)); |
957 | *dst = ip6_route_output(sk->sk_net, sk, &fl_gw); | 959 | *dst = ip6_route_output(net, sk, &fl_gw); |
958 | if ((err = (*dst)->error)) | 960 | if ((err = (*dst)->error)) |
959 | goto out_err_release; | 961 | goto out_err_release; |
960 | } | 962 | } |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 5eea6fa506e5..c11c76cab371 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -107,6 +107,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, | |||
107 | char __user *optval, int optlen) | 107 | char __user *optval, int optlen) |
108 | { | 108 | { |
109 | struct ipv6_pinfo *np = inet6_sk(sk); | 109 | struct ipv6_pinfo *np = inet6_sk(sk); |
110 | struct net *net = sk->sk_net; | ||
110 | int val, valbool; | 111 | int val, valbool; |
111 | int retv = -ENOPROTOOPT; | 112 | int retv = -ENOPROTOOPT; |
112 | 113 | ||
@@ -432,7 +433,7 @@ done: | |||
432 | if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != val) | 433 | if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != val) |
433 | goto e_inval; | 434 | goto e_inval; |
434 | 435 | ||
435 | if (__dev_get_by_index(&init_net, val) == NULL) { | 436 | if (__dev_get_by_index(net, val) == NULL) { |
436 | retv = -ENODEV; | 437 | retv = -ENODEV; |
437 | break; | 438 | break; |
438 | } | 439 | } |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 15e9a86f28c8..a4b5aee0f68a 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -2261,7 +2261,7 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void | |||
2261 | skb_reset_mac_header(skb); | 2261 | skb_reset_mac_header(skb); |
2262 | skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr)); | 2262 | skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr)); |
2263 | 2263 | ||
2264 | rt = (struct rt6_info*) ip6_route_output(&init_net, NULL, &fl); | 2264 | rt = (struct rt6_info*) ip6_route_output(net, NULL, &fl); |
2265 | skb->dst = &rt->u.dst; | 2265 | skb->dst = &rt->u.dst; |
2266 | 2266 | ||
2267 | err = rt6_fill_node(skb, rt, &fl.fl6_dst, &fl.fl6_src, iif, | 2267 | err = rt6_fill_node(skb, rt, &fl.fl6_dst, &fl.fl6_src, iif, |