[NET] NETNS: Omit namespace comparision without CONFIG_NET_NS.
Introduce an inline net_eq() to compare two namespaces. Without CONFIG_NET_NS, since no namespace other than &init_net exists, it is always 1. We do not need to convert 1) inline vs inline and 2) inline vs &init_net comparisons. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
This commit is contained in:
@@ -252,7 +252,7 @@ static struct sock *__unix_find_socket_byname(struct net *net,
|
||||
sk_for_each(s, node, &unix_socket_table[hash ^ type]) {
|
||||
struct unix_sock *u = unix_sk(s);
|
||||
|
||||
if (sock_net(s) != net)
|
||||
if (!net_eq(sock_net(s), net))
|
||||
continue;
|
||||
|
||||
if (u->addr->len == len &&
|
||||
@@ -289,7 +289,7 @@ static struct sock *unix_find_socket_byinode(struct net *net, struct inode *i)
|
||||
&unix_socket_table[i->i_ino & (UNIX_HASH_SIZE - 1)]) {
|
||||
struct dentry *dentry = unix_sk(s)->dentry;
|
||||
|
||||
if (sock_net(s) != net)
|
||||
if (!net_eq(sock_net(s), net))
|
||||
continue;
|
||||
|
||||
if(dentry && dentry->d_inode == i)
|
||||
|
Reference in New Issue
Block a user