]> err.no Git - linux-2.6/commitdiff
[IPV6] NETNS: Handle ancillary data in appropriate namespace.
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Wed, 4 Jun 2008 04:02:49 +0000 (13:02 +0900)
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Wed, 4 Jun 2008 19:02:36 +0000 (04:02 +0900)
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
include/net/transp_v6.h
net/ipv6/datagram.c
net/ipv6/ip6_flowlabel.c
net/ipv6/ipv6_sockglue.c
net/ipv6/raw.c
net/ipv6/udp.c

index 27394e0447d88d9b5d788b14b8e4bed582b45817..112934a3288d598868ca19f2a471e52a0d07066e 100644 (file)
@@ -40,7 +40,8 @@ extern int                    datagram_recv_ctl(struct sock *sk,
                                                  struct msghdr *msg,
                                                  struct sk_buff *skb);
 
-extern int                     datagram_send_ctl(struct msghdr *msg,
+extern int                     datagram_send_ctl(struct net *net,
+                                                 struct msghdr *msg,
                                                  struct flowi *fl,
                                                  struct ipv6_txoptions *opt,
                                                  int *hlimit, int *tclass);
index 53e3883f76668f847e2241ae93f65134bd2962fd..b9c2de84a8a212d137e1ba0c17bc1125dd5b288d 100644 (file)
@@ -496,7 +496,8 @@ int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb)
        return 0;
 }
 
-int datagram_send_ctl(struct msghdr *msg, struct flowi *fl,
+int datagram_send_ctl(struct net *net,
+                     struct msghdr *msg, struct flowi *fl,
                      struct ipv6_txoptions *opt,
                      int *hlimit, int *tclass)
 {
@@ -540,7 +541,7 @@ int datagram_send_ctl(struct msghdr *msg, struct flowi *fl,
                        addr_type = __ipv6_addr_type(&src_info->ipi6_addr);
 
                        if (fl->oif) {
-                               dev = dev_get_by_index(&init_net, fl->oif);
+                               dev = dev_get_by_index(net, fl->oif);
                                if (!dev)
                                        return -ENODEV;
                        } else if (addr_type & IPV6_ADDR_LINKLOCAL)
@@ -548,7 +549,7 @@ int datagram_send_ctl(struct msghdr *msg, struct flowi *fl,
 
                        if (addr_type != IPV6_ADDR_ANY) {
                                int strict = __ipv6_addr_src_scope(addr_type) <= IPV6_ADDR_SCOPE_LINKLOCAL;
-                               if (!ipv6_chk_addr(&init_net, &src_info->ipi6_addr,
+                               if (!ipv6_chk_addr(net, &src_info->ipi6_addr,
                                                   strict ? dev : NULL, 0))
                                        err = -EINVAL;
                                else
index eb7a940310f41006b82fc27c6eda57455d40ca85..37a4e777e3476e0d59060e2694e374ac7408dcc1 100644 (file)
@@ -354,7 +354,7 @@ fl_create(struct net *net, struct in6_flowlabel_req *freq, char __user *optval,
                msg.msg_control = (void*)(fl->opt+1);
                flowi.oif = 0;
 
-               err = datagram_send_ctl(&msg, &flowi, fl->opt, &junk, &junk);
+               err = datagram_send_ctl(net, &msg, &flowi, fl->opt, &junk, &junk);
                if (err)
                        goto done;
                err = -EINVAL;
index 9293b9f0ac232134473c22d50c9ba38b651086ab..3eef8e5b3636ef1ba4d80d455619555dbbaa6109 100644 (file)
@@ -416,7 +416,7 @@ sticky_done:
                msg.msg_controllen = optlen;
                msg.msg_control = (void*)(opt+1);
 
-               retv = datagram_send_ctl(&msg, &fl, opt, &junk, &junk);
+               retv = datagram_send_ctl(net, &msg, &fl, opt, &junk, &junk);
                if (retv)
                        goto done;
 update:
index 232e0dc45bf58a91526d3f292eb7b90b654fcac3..603df76e052267f5882952e59e51296912143653 100644 (file)
@@ -813,7 +813,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
                memset(opt, 0, sizeof(struct ipv6_txoptions));
                opt->tot_len = sizeof(struct ipv6_txoptions);
 
-               err = datagram_send_ctl(msg, &fl, opt, &hlimit, &tclass);
+               err = datagram_send_ctl(sock_net(sk), msg, &fl, opt, &hlimit, &tclass);
                if (err < 0) {
                        fl6_sock_release(flowlabel);
                        return err;
index 47123bf5eb0fb439a944cfbcfe99112b97e157d1..1b35c4722004551e9b92eb498a0f1037c44ed8bf 100644 (file)
@@ -731,7 +731,7 @@ do_udp_sendmsg:
                memset(opt, 0, sizeof(struct ipv6_txoptions));
                opt->tot_len = sizeof(*opt);
 
-               err = datagram_send_ctl(msg, &fl, opt, &hlimit, &tclass);
+               err = datagram_send_ctl(sock_net(sk), msg, &fl, opt, &hlimit, &tclass);
                if (err < 0) {
                        fl6_sock_release(flowlabel);
                        return err;