diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 13:26:21 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 15:39:55 -0400 |
commit | 3b1e0a655f8eba44ab1ee2a1068d169ccfb853b9 (patch) | |
tree | 09edb35f32ebcfb1b4dad904425128a110ef16ee /net/ipv4/af_inet.c | |
parent | c346dca10840a874240c78efe3f39acf4312a1f2 (diff) |
[NET] NETNS: Omit sock->sk_net without CONFIG_NET_NS.
Introduce per-sock inlines: sock_net(), sock_net_set()
and per-inet_timewait_sock inlines: twsk_net(), twsk_net_set().
Without CONFIG_NET_NS, no namespace other than &init_net exists.
Let's explicitly define them to help compiler optimizations.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r-- | net/ipv4/af_inet.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 06cfb0bed631..5882a1316441 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -464,7 +464,7 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
464 | if (addr_len < sizeof(struct sockaddr_in)) | 464 | if (addr_len < sizeof(struct sockaddr_in)) |
465 | goto out; | 465 | goto out; |
466 | 466 | ||
467 | chk_addr_ret = inet_addr_type(sk->sk_net, addr->sin_addr.s_addr); | 467 | chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr); |
468 | 468 | ||
469 | /* Not specified by any standard per-se, however it breaks too | 469 | /* Not specified by any standard per-se, however it breaks too |
470 | * many applications when removed. It is unfortunate since | 470 | * many applications when removed. It is unfortunate since |
@@ -802,7 +802,7 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
802 | { | 802 | { |
803 | struct sock *sk = sock->sk; | 803 | struct sock *sk = sock->sk; |
804 | int err = 0; | 804 | int err = 0; |
805 | struct net *net = sk->sk_net; | 805 | struct net *net = sock_net(sk); |
806 | 806 | ||
807 | switch (cmd) { | 807 | switch (cmd) { |
808 | case SIOCGSTAMP: | 808 | case SIOCGSTAMP: |
@@ -1132,7 +1132,7 @@ int inet_sk_rebuild_header(struct sock *sk) | |||
1132 | }; | 1132 | }; |
1133 | 1133 | ||
1134 | security_sk_classify_flow(sk, &fl); | 1134 | security_sk_classify_flow(sk, &fl); |
1135 | err = ip_route_output_flow(sk->sk_net, &rt, &fl, sk, 0); | 1135 | err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk, 0); |
1136 | } | 1136 | } |
1137 | if (!err) | 1137 | if (!err) |
1138 | sk_setup_caps(sk, &rt->u.dst); | 1138 | sk_setup_caps(sk, &rt->u.dst); |