diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2020-02-19 16:54:05 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-02-19 16:54:24 +0100 |
commit | 2f14b2d9dd80427a1c07451b623afb8b85efef21 (patch) | |
tree | 20be453de9bbad27e82af5f26490e642ccda7437 /include/linux/skmsg.h | |
parent | b80b033bedae68dae8fc703ab8a69811ce678f2e (diff) | |
parent | d1ba1204f2eec134937cb32997ee47756d448aa2 (diff) |
Merge branch 'bpf-skmsg-simplify-restore'
Jakub Sitnicki says:
====================
This series has been split out from "Extend SOCKMAP to store listening
sockets" [0]. I think it stands on its own, and makes the latter series
smaller, which will make the review easier, hopefully.
The essence is that we don't need to do a complicated dance in
sk_psock_restore_proto, if we agree that the contract with tcp_update_ulp
is to restore callbacks even when the socket doesn't use ULP. This is what
tcp_update_ulp currently does, and we just make use of it.
Series is accompanied by a test for a particularly tricky case of restoring
callbacks when we have both sockmap and tls callbacks configured in
sk->sk_prot.
[0] https://lore.kernel.org/bpf/20200127131057.150941-1-jakub@cloudflare.com/
====================
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux/skmsg.h')
-rw-r--r-- | include/linux/skmsg.h | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h index 14d61bba0b79..d90ef61712a1 100644 --- a/include/linux/skmsg.h +++ b/include/linux/skmsg.h @@ -359,22 +359,7 @@ static inline void sk_psock_restore_proto(struct sock *sk, struct sk_psock *psock) { sk->sk_prot->unhash = psock->saved_unhash; - - if (psock->sk_proto) { - struct inet_connection_sock *icsk = inet_csk(sk); - bool has_ulp = !!icsk->icsk_ulp_data; - - if (has_ulp) { - tcp_update_ulp(sk, psock->sk_proto, - psock->saved_write_space); - } else { - sk->sk_prot = psock->sk_proto; - sk->sk_write_space = psock->saved_write_space; - } - psock->sk_proto = NULL; - } else { - sk->sk_write_space = psock->saved_write_space; - } + tcp_update_ulp(sk, psock->sk_proto, psock->saved_write_space); } static inline void sk_psock_set_state(struct sk_psock *psock, |