[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>
This commit is contained in:
@@ -1512,7 +1512,7 @@ rtattr_failure:
|
||||
*/
|
||||
static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void *arg)
|
||||
{
|
||||
struct net *net = in_skb->sk->sk_net;
|
||||
struct net *net = sock_net(in_skb->sk);
|
||||
struct rtattr **rta = arg;
|
||||
struct rtmsg *rtm = NLMSG_DATA(nlh);
|
||||
struct dn_route *rt = NULL;
|
||||
@@ -1601,7 +1601,7 @@ out_free:
|
||||
*/
|
||||
int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb)
|
||||
{
|
||||
struct net *net = skb->sk->sk_net;
|
||||
struct net *net = sock_net(skb->sk);
|
||||
struct dn_route *rt;
|
||||
int h, s_h;
|
||||
int idx, s_idx;
|
||||
|
Reference in New Issue
Block a user