Message ID | 20200527195849.97118-1-zeil@yandex-team.ru |
---|---|
State | Accepted |
Delegated to: | BPF Maintainers |
Headers | show |
Series | [bpf-next,v2,1/3] sock: move sock_valbool_flag to header | expand |
On Wed, May 27, 2020 at 1:00 PM Dmitry Yakunin <zeil@yandex-team.ru> wrote: > > This is preparation for usage in bpf_setsockopt. > > Signed-off-by: Dmitry Yakunin <zeil@yandex-team.ru> > Acked-by: Martin KaFai Lau <kafai@fb.com> Applied the set. Thanks
On Mon, Jun 1, 2020 at 1:32 PM Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote: > > On Wed, May 27, 2020 at 1:00 PM Dmitry Yakunin <zeil@yandex-team.ru> wrote: > > > > This is preparation for usage in bpf_setsockopt. > > > > Signed-off-by: Dmitry Yakunin <zeil@yandex-team.ru> > > Acked-by: Martin KaFai Lau <kafai@fb.com> > > Applied the set. Thanks I had to drop it due to non-trivial conflict with net-next :( Commit 71c48eb81c9e ("tcp: add tcp_sock_set_keepidle") introduced __tcp_sock_set_keepidle() which is exactly the patch 2. I didn't want to do such surgery. Pls respin.
diff --git a/include/net/sock.h b/include/net/sock.h index 3e8c6d4..ee35dea 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -879,6 +879,15 @@ static inline void sock_reset_flag(struct sock *sk, enum sock_flags flag) __clear_bit(flag, &sk->sk_flags); } +static inline void sock_valbool_flag(struct sock *sk, enum sock_flags bit, + int valbool) +{ + if (valbool) + sock_set_flag(sk, bit); + else + sock_reset_flag(sk, bit); +} + static inline bool sock_flag(const struct sock *sk, enum sock_flags flag) { return test_bit(flag, &sk->sk_flags); diff --git a/net/core/sock.c b/net/core/sock.c index fd85e65..9836b01 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -684,15 +684,6 @@ static int sock_getbindtodevice(struct sock *sk, char __user *optval, return ret; } -static inline void sock_valbool_flag(struct sock *sk, enum sock_flags bit, - int valbool) -{ - if (valbool) - sock_set_flag(sk, bit); - else - sock_reset_flag(sk, bit); -} - bool sk_mc_loop(struct sock *sk) { if (dev_recursion_level())