aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/route.h
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 13:26:21 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 15:39:55 -0400
commit3b1e0a655f8eba44ab1ee2a1068d169ccfb853b9 (patch)
tree09edb35f32ebcfb1b4dad904425128a110ef16ee /include/net/route.h
parentc346dca10840a874240c78efe3f39acf4312a1f2 (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 'include/net/route.h')
-rw-r--r--include/net/route.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/route.h b/include/net/route.h
index 28dba925663c..c6338802e8f1 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -160,7 +160,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
160 .dport = dport } } }; 160 .dport = dport } } };
161 161
162 int err; 162 int err;
163 struct net *net = sk->sk_net; 163 struct net *net = sock_net(sk);
164 if (!dst || !src) { 164 if (!dst || !src) {
165 err = __ip_route_output_key(net, rp, &fl); 165 err = __ip_route_output_key(net, rp, &fl);
166 if (err) 166 if (err)
@@ -188,7 +188,7 @@ static inline int ip_route_newports(struct rtable **rp, u8 protocol,
188 ip_rt_put(*rp); 188 ip_rt_put(*rp);
189 *rp = NULL; 189 *rp = NULL;
190 security_sk_classify_flow(sk, &fl); 190 security_sk_classify_flow(sk, &fl);
191 return ip_route_output_flow(sk->sk_net, rp, &fl, sk, 0); 191 return ip_route_output_flow(sock_net(sk), rp, &fl, sk, 0);
192 } 192 }
193 return 0; 193 return 0;
194} 194}