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
..
2017-07-11 06:08:58 -04:00
2017-11-27 16:20:04 -05:00
2018-01-19 14:02:12 -05:00
2017-11-27 16:20:04 -05:00
2018-02-07 11:55:52 +01:00
2018-03-22 15:12:56 -04:00
2017-04-05 10:15:20 +02:00
2017-10-07 23:15:08 +01:00
2018-03-17 20:11:22 -04:00
2018-01-23 19:51:46 -05:00
2017-04-12 22:02:36 +02:00
2018-03-09 11:25:11 -05:00
2018-03-16 11:28:38 -04:00
2017-10-18 11:42:48 +01:00
2017-11-02 11:10:55 +01:00
2017-10-05 18:44:17 -07:00
2017-11-02 11:10:55 +01:00
2018-01-15 14:53:43 -05:00
2017-11-02 11:10:55 +01:00
2018-02-14 11:55:33 -05:00
2017-05-27 18:51:41 -04:00
2017-10-25 10:54:39 +09:00
2017-08-11 14:59:24 -07:00
2017-07-04 22:35:16 +01:00
2018-02-27 13:30:53 +01:00
2017-07-04 01:29:04 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-03-23 12:14:18 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-18 12:39:36 +01:00
2017-11-30 09:54:25 -05:00
2017-11-04 09:26:51 +09:00
2018-03-04 13:34:18 -05:00
2017-11-02 11:10:55 +01:00
2018-03-05 12:52:45 -05:00
2017-11-04 09:26:51 +09:00
2017-11-02 11:10:55 +01:00
2018-03-05 12:52:45 -05:00
2018-02-06 11:32:48 -05:00
2017-11-02 11:10:55 +01:00
2018-02-28 11:43:28 -05:00
2017-11-01 11:50:43 +09:00
2018-03-04 13:04:22 -05:00
2017-11-02 11:10:55 +01:00
2017-11-11 15:36:05 +09:00
2018-03-04 13:04:23 -05:00
2017-11-02 11:10:55 +01:00
2017-10-30 21:09:24 +09:00
2017-10-11 09:49:34 +02:00
2017-11-02 11:10:55 +01:00
2017-12-08 13:32:26 -05:00
2017-11-16 10:49:00 +09:00
2017-11-02 11:10:55 +01:00
2018-02-27 14:46:26 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-11 14:10:06 -05:00
2017-11-02 11:10:55 +01:00
2018-02-22 21:13:02 +01:00
2017-07-04 01:29:04 -07:00
2017-11-02 11:10:55 +01:00
2017-08-07 11:39:22 -07:00
2018-03-31 02:15:43 +02:00
2018-02-28 11:43:28 -05:00
2017-11-04 09:26:51 +09:00
2017-11-04 09:26:51 +09:00
2017-12-03 10:18:28 -05:00
2017-12-20 14:00:25 -05:00
2017-12-13 14:33:10 -05:00
2017-11-02 11:10:55 +01:00
2018-03-04 13:04:22 -05:00
2018-03-23 11:31:58 -04:00
2017-12-15 12:34:00 -05:00
2018-03-23 11:31:58 -04:00
2018-03-09 11:23:11 -05:00
2018-01-08 18:01:02 +01:00
2018-03-23 11:31:58 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-03-31 02:15:43 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-25 12:06:25 +09:00
2017-07-04 22:35:15 +01:00
2018-02-14 14:43:32 -05:00
2018-03-23 11:31:58 -04:00
2017-11-02 11:10:55 +01:00
2017-04-01 20:21:44 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-04 09:26:51 +09:00
2018-03-22 11:16:42 -04:00
2017-11-02 11:10:55 +01:00
2018-03-04 13:04:23 -05:00
2017-07-01 07:39:09 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-08 16:12:33 +09:00
2017-11-02 11:10:55 +01:00
2018-02-28 12:06:01 -05:00
2018-01-16 14:56:54 -05:00
2017-11-02 11:10:55 +01:00
2017-10-01 03:55:47 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-08-07 11:39:21 -07:00
2017-11-02 11:10:55 +01:00
2017-12-05 14:37:13 -05:00
2018-02-22 20:57:48 +01:00
2017-10-20 13:21:36 +01:00
2017-11-02 11:10:55 +01:00
2018-03-23 11:31:58 -04:00
2017-12-04 11:32:53 -05:00
2018-03-23 11:31:58 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-08-25 17:10:23 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-03-30 00:09:43 +02:00
2018-03-01 21:21:36 -05:00
2017-11-02 11:10:55 +01:00
2017-10-25 10:37:11 +09:00
2017-11-10 13:41:40 +09:00
2018-02-21 15:06:05 -05:00
2018-03-01 21:44:28 -05:00
2017-11-11 15:36:05 +09:00
2018-01-31 10:26:30 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-08-29 15:16:52 -07:00
2017-11-02 11:10:55 +01:00
2017-11-27 16:20:04 -05:00
2018-02-16 15:57:42 -05:00
2018-01-17 16:07:24 -05:00
2018-01-24 19:13:45 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-01-05 15:21:21 -08:00
2018-02-28 11:43:28 -05:00