mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
net: add sock_set_reuseport
Add a helper to directly set the SO_REUSEPORT sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
26cfabf9cd
commit
fe31a326a4
3 changed files with 10 additions and 16 deletions
|
@ -729,6 +729,14 @@ void sock_set_reuseaddr(struct sock *sk)
|
|||
}
|
||||
EXPORT_SYMBOL(sock_set_reuseaddr);
|
||||
|
||||
void sock_set_reuseport(struct sock *sk)
|
||||
{
|
||||
lock_sock(sk);
|
||||
sk->sk_reuseport = true;
|
||||
release_sock(sk);
|
||||
}
|
||||
EXPORT_SYMBOL(sock_set_reuseport);
|
||||
|
||||
void sock_no_linger(struct sock *sk)
|
||||
{
|
||||
lock_sock(sk);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue