Skip to content

Commit 1f139ed

Browse files
Jakub Sitnickidavem330
authored andcommitted
ipv6: Avoid going through ->sk_net to access the netns
There is no need to go through sk->sk_net to access the net namespace and its sysctl variables because we allocate the sock and initialize sk_net just a few lines earlier in the same routine. Signed-off-by: Jakub Sitnicki <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 98c13bb commit 1f139ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv6/af_inet6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static int inet6_create(struct net *net, struct socket *sock, int protocol,
210210
np->mcast_hops = IPV6_DEFAULT_MCASTHOPS;
211211
np->mc_loop = 1;
212212
np->pmtudisc = IPV6_PMTUDISC_WANT;
213-
np->autoflowlabel = ip6_default_np_autolabel(sock_net(sk));
213+
np->autoflowlabel = ip6_default_np_autolabel(net);
214214
sk->sk_ipv6only = net->ipv6.sysctl.bindv6only;
215215

216216
/* Init the ipv4 part of the socket since we can have sockets

0 commit comments

Comments
 (0)