summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorFerenc Fejes <fejes@inf.elte.hu>2020-05-30 23:09:00 +0200
committerAlexei Starovoitov <ast@kernel.org>2020-06-01 14:57:14 -0700
commit8ea204c2b658eaef55b4716fde469fb66c589a3d (patch)
treedc158cbccc05c8a068e015ada9d29d4f0a9d42c4 /net/ipv6
parentbb2359f4dbe98e8863b4e885fc09269ef4682ec3 (diff)
downloadlinux-8ea204c2b658eaef55b4716fde469fb66c589a3d.tar.gz
linux-8ea204c2b658eaef55b4716fde469fb66c589a3d.tar.bz2
linux-8ea204c2b658eaef55b4716fde469fb66c589a3d.zip
net: Make locking in sock_bindtoindex optional
The sock_bindtoindex intended for kernel wide usage however it will lock the socket regardless of the context. This modification relax this behavior optionally: locking the socket will be optional by calling the sock_bindtoindex with lock_sk = true. The modification applied to all users of the sock_bindtoindex. Signed-off-by: Ferenc Fejes <fejes@inf.elte.hu> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/bee6355da40d9e991b2f2d12b67d55ebb5f5b207.1590871065.git.fejes@inf.elte.hu
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/ip6_udp_tunnel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/ip6_udp_tunnel.c b/net/ipv6/ip6_udp_tunnel.c
index 2e0ad1bc84a8..cdc4d4ee2420 100644
--- a/net/ipv6/ip6_udp_tunnel.c
+++ b/net/ipv6/ip6_udp_tunnel.c
@@ -30,7 +30,7 @@ int udp_sock_create6(struct net *net, struct udp_port_cfg *cfg,
goto error;
}
if (cfg->bind_ifindex) {
- err = sock_bindtoindex(sock->sk, cfg->bind_ifindex);
+ err = sock_bindtoindex(sock->sk, cfg->bind_ifindex, true);
if (err < 0)
goto error;
}