OSDN Git Service

bpf: add TCP_SAVE_SYN/TCP_SAVED_SYN options for bpf_(set|get)sockopt
authorNikita V. Shirokov <tehnerd@fb.com>
Thu, 30 Aug 2018 14:51:53 +0000 (07:51 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 31 Aug 2018 23:35:59 +0000 (01:35 +0200)
commit1e215300f1384072c62459a1c194a08dbe05ff2c
treec6cf00bf6e1509ebc1e829952ff8712ce067baaa
parent7296216776dbbe5094e218035debe1c0a5a3674a
bpf: add TCP_SAVE_SYN/TCP_SAVED_SYN options for bpf_(set|get)sockopt

Adding support for two new bpf get/set sockopts: TCP_SAVE_SYN (set)
and TCP_SAVED_SYN (get). This would allow for bpf program to build
logic based on data from ingress SYN packet (e.g. doing tcp's tos/
tclass reflection (see sample prog)) and do it transparently from
userspace program point of view.

Signed-off-by: Nikita V. Shirokov <tehnerd@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
net/core/filter.c