diff options
author | Denis V. Lunev <den@openvz.org> | 2008-03-24 18:30:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-24 18:30:27 -0400 |
commit | 7a6adb92fe301c10ca4dbd0d9f2422f5880595e7 (patch) | |
tree | b2b82f828a6eeaa788ee1d378d45e612e4a6d527 | |
parent | f2c4802b3fdfb0d9596d932ca2af0ef6f8d60491 (diff) |
[NETNS]: Add namespace parameter to ip_cmsg_send.
Pass the init_net there for now.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/ip.h | 3 | ||||
-rw-r--r-- | net/ipv4/ip_sockglue.c | 4 | ||||
-rw-r--r-- | net/ipv4/raw.c | 2 | ||||
-rw-r--r-- | net/ipv4/udp.c | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/include/net/ip.h b/include/net/ip.h index 531270dc48a6..6d7bcd5e62d4 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -362,7 +362,8 @@ extern int ip_options_rcv_srr(struct sk_buff *skb); | |||
362 | */ | 362 | */ |
363 | 363 | ||
364 | extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); | 364 | extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); |
365 | extern int ip_cmsg_send(struct msghdr *msg, struct ipcm_cookie *ipc); | 365 | extern int ip_cmsg_send(struct net *net, |
366 | struct msghdr *msg, struct ipcm_cookie *ipc); | ||
366 | extern int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen); | 367 | extern int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen); |
367 | extern int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen); | 368 | extern int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen); |
368 | extern int compat_ip_setsockopt(struct sock *sk, int level, | 369 | extern int compat_ip_setsockopt(struct sock *sk, int level, |
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 1b86a50269bc..0857f2d042cd 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -163,7 +163,7 @@ void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb) | |||
163 | ip_cmsg_recv_security(msg, skb); | 163 | ip_cmsg_recv_security(msg, skb); |
164 | } | 164 | } |
165 | 165 | ||
166 | int ip_cmsg_send(struct msghdr *msg, struct ipcm_cookie *ipc) | 166 | int ip_cmsg_send(struct net *net, struct msghdr *msg, struct ipcm_cookie *ipc) |
167 | { | 167 | { |
168 | int err; | 168 | int err; |
169 | struct cmsghdr *cmsg; | 169 | struct cmsghdr *cmsg; |
@@ -176,7 +176,7 @@ int ip_cmsg_send(struct msghdr *msg, struct ipcm_cookie *ipc) | |||
176 | switch (cmsg->cmsg_type) { | 176 | switch (cmsg->cmsg_type) { |
177 | case IP_RETOPTS: | 177 | case IP_RETOPTS: |
178 | err = cmsg->cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr)); | 178 | err = cmsg->cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr)); |
179 | err = ip_options_get(&init_net, &ipc->opt, CMSG_DATA(cmsg), err < 40 ? err : 40); | 179 | err = ip_options_get(net, &ipc->opt, CMSG_DATA(cmsg), err < 40 ? err : 40); |
180 | if (err) | 180 | if (err) |
181 | return err; | 181 | return err; |
182 | break; | 182 | break; |
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index b433b485a883..7d29a05bf887 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -499,7 +499,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
499 | ipc.oif = sk->sk_bound_dev_if; | 499 | ipc.oif = sk->sk_bound_dev_if; |
500 | 500 | ||
501 | if (msg->msg_controllen) { | 501 | if (msg->msg_controllen) { |
502 | err = ip_cmsg_send(msg, &ipc); | 502 | err = ip_cmsg_send(&init_net, msg, &ipc); |
503 | if (err) | 503 | if (err) |
504 | goto out; | 504 | goto out; |
505 | if (ipc.opt) | 505 | if (ipc.opt) |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 9cd48b0bb7d4..d142b87e9eb8 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -607,7 +607,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
607 | 607 | ||
608 | ipc.oif = sk->sk_bound_dev_if; | 608 | ipc.oif = sk->sk_bound_dev_if; |
609 | if (msg->msg_controllen) { | 609 | if (msg->msg_controllen) { |
610 | err = ip_cmsg_send(msg, &ipc); | 610 | err = ip_cmsg_send(&init_net, msg, &ipc); |
611 | if (err) | 611 | if (err) |
612 | return err; | 612 | return err; |
613 | if (ipc.opt) | 613 | if (ipc.opt) |