alistair23-linux/include
Andrey Ignatov 3679d585bb net: Introduce __inet_bind() and __inet6_bind
Refactor `bind()` code to make it ready to be called from BPF helper
function `bpf_bind()` (will be added soon). Implementation of
`inet_bind()` and `inet6_bind()` is separated into `__inet_bind()` and
`__inet6_bind()` correspondingly. These function can be used from both
`sk_prot->bind` and `bpf_bind()` contexts.

New functions have two additional arguments.

`force_bind_address_no_port` forces binding to IP only w/o checking
`inet_sock.bind_address_no_port` field. It'll allow to bind local end of
a connection to desired IP in `bpf_bind()` w/o changing
`bind_address_no_port` field of a socket. It's useful since `bpf_bind()`
can return an error and we'd need to restore original value of
`bind_address_no_port` in that case if we changed this before calling to
the helper.

`with_lock` specifies whether to lock socket when working with `struct
sk` or not. The argument is set to `true` for `sk_prot->bind`, i.e. old
behavior is preserved. But it will be set to `false` for `bpf_bind()`
use-case. The reason is all call-sites, where `bpf_bind()` will be
called, already hold that socket lock.

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-03-31 02:15:43 +02:00
..
acpi ACPICA: Update version to 20180105 2018-02-06 10:32:13 +01:00
asm-generic bpf: introduce BPF_RAW_TRACEPOINT 2018-03-28 22:55:19 +02:00
clocksource
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-01-31 14:22:45 -08:00
drm drm/nouveau: prefer XBGR2101010 for addfb ioctl 2018-02-23 13:51:42 +01:00
dt-bindings net: phy: dp83867: Add binding for the CLK_OUT pin muxing option 2018-02-14 15:33:43 -05:00
keys
kvm KVM: arm/arm64: Reset mapped IRQs on VM reset 2018-03-14 18:29:14 +00:00
linux bpf: Hooks for sys_bind 2018-03-31 02:15:18 +02:00
math-emu
media media: dvb: update buffer mmaped flags and frame counter 2018-02-23 11:44:08 -05:00
memory
misc powerpc updates for 4.16 2018-02-02 10:01:04 -08:00
net net: Introduce __inet_bind() and __inet6_bind 2018-03-31 02:15:43 +02:00
pcmcia
ras
rdma RDMA/verbs: Remove restrack entry from XRCD structure 2018-03-19 14:10:30 -06:00
scsi SCSI fixes on 20180306 2018-03-07 10:50:15 -08:00
soc ARC fixes for 4.16-rc4 2018-03-01 14:32:23 -08:00
sound Merge branch 'topic/fixes' into for-linus 2018-02-12 09:36:26 +01:00
target
trace bpf: introduce BPF_RAW_TRACEPOINT 2018-03-28 22:55:19 +02:00
uapi bpf: Hooks for sys_bind 2018-03-31 02:15:18 +02:00
video fbdev changes for v4.16: 2018-02-07 13:10:43 -08:00
xen