aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/af_inet.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index b1462e8c64cf..fe03048c130d 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -245,7 +245,7 @@ static inline int inet_netns_ok(struct net *net, int protocol)
245 int hash; 245 int hash;
246 struct net_protocol *ipprot; 246 struct net_protocol *ipprot;
247 247
248 if (net == &init_net) 248 if (net_eq(net, &init_net))
249 return 1; 249 return 1;
250 250
251 hash = protocol & (MAX_INET_PROTOS - 1); 251 hash = protocol & (MAX_INET_PROTOS - 1);
@@ -272,10 +272,9 @@ static int inet_create(struct net *net, struct socket *sock, int protocol)
272 int try_loading_module = 0; 272 int try_loading_module = 0;
273 int err; 273 int err;
274 274
275 if (sock->type != SOCK_RAW && 275 if (unlikely(!inet_ehash_secret))
276 sock->type != SOCK_DGRAM && 276 if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM)
277 !inet_ehash_secret) 277 build_ehash_secret();
278 build_ehash_secret();
279 278
280 sock->state = SS_UNCONNECTED; 279 sock->state = SS_UNCONNECTED;
281 280