]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: net: Add SO_DETACH_REUSEPORT_BPF
authorMartin KaFai Lau <kafai@fb.com>
Thu, 13 Jun 2019 22:00:01 +0000 (15:00 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 14 Jun 2019 23:21:19 +0000 (01:21 +0200)
commit224808a758c1f05062e31577d86a7a57055fc993
treeb5eb23bfcbf922d9773265810bb4119e57a31a8a
parentf37cfbc780343eaa03b635c0674790772012462b
bpf: net: Add SO_DETACH_REUSEPORT_BPF

There is SO_ATTACH_REUSEPORT_[CE]BPF but there is no DETACH.
This patch adds SO_DETACH_REUSEPORT_BPF sockopt.  The same
sockopt can be used to undo both SO_ATTACH_REUSEPORT_[CE]BPF.

reseport_detach_prog() is added and it is mostly a mirror
of the existing reuseport_attach_prog().  The differences are,
it does not call reuseport_alloc() and returns -ENOENT when
there is no old prog.

Cc: Craig Gallek <kraig@google.com>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
arch/alpha/include/uapi/asm/socket.h
arch/mips/include/uapi/asm/socket.h
arch/parisc/include/uapi/asm/socket.h
arch/sparc/include/uapi/asm/socket.h
include/net/sock_reuseport.h
include/uapi/asm-generic/socket.h
net/core/sock.c
net/core/sock_reuseport.c