mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
BACKPORT: 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. Change-Id: I9dc573d405527847ceeaa8d5d04f0c90fb5ab874 Signed-off-by: Ferenc Fejes <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/bee6355da40d9e991b2f2d12b67d55ebb5f5b207.1590871065.git.fejes@inf.elte.hu
This commit is contained in:
parent
c1aa7dc417
commit
7d942dce7e
4 changed files with 9 additions and 7 deletions
|
|
@ -22,7 +22,7 @@ int udp_sock_create4(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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue