net: add sock_no_linger

Add a helper to directly set the SO_LINGER sockopt from kernel space
with onoff set to true and a linger time of 0 without going through a
fake uaccess.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Christoph Hellwig
2020-05-28 07:12:10 +02:00
committed by David S. Miller
parent b58f0e8f38
commit c433594c07
8 changed files with 16 additions and 37 deletions

View File

@ -2688,6 +2688,7 @@ static inline bool sk_dev_equal_l3scope(struct sock *sk, int dif)
void sock_def_readable(struct sock *sk);
void sock_no_linger(struct sock *sk);
void sock_set_reuseaddr(struct sock *sk);
#endif /* _SOCK_H */