diff options
author | Michal Sekletar <msekleta@redhat.com> | 2014-01-17 17:09:45 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-18 19:08:58 -0800 |
commit | ea02f9411d9faa3553ed09ce0ec9f00ceae9885e (patch) | |
tree | c058c0f3060402a8778ed077f7dc092e62fc0958 /arch/cris | |
parent | 41804420586ab41049a14ab7ef04eaa2280b8647 (diff) | |
download | kernel-common-ea02f9411d9faa3553ed09ce0ec9f00ceae9885e.tar.gz kernel-common-ea02f9411d9faa3553ed09ce0ec9f00ceae9885e.tar.bz2 kernel-common-ea02f9411d9faa3553ed09ce0ec9f00ceae9885e.zip |
net: introduce SO_BPF_EXTENSIONS
For user space packet capturing libraries such as libpcap, there's
currently only one way to check which BPF extensions are supported
by the kernel, that is, commit aa1113d9f85d ("net: filter: return
-EINVAL if BPF_S_ANC* operation is not supported"). For querying all
extensions at once this might be rather inconvenient.
Therefore, this patch introduces a new option which can be used as
an argument for getsockopt(), and allows one to obtain information
about which BPF extensions are supported by the current kernel.
As David Miller suggests, we do not need to define any bits right
now and status quo can just return 0 in order to state that this
versions supports SKF_AD_PROTOCOL up to SKF_AD_PAY_OFFSET. Later
additions to BPF extensions need to add their bits to the
bpf_tell_extensions() function, as documented in the comment.
Signed-off-by: Michal Sekletar <msekleta@redhat.com>
Cc: David Miller <davem@davemloft.net>
Reviewed-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/cris')
-rw-r--r-- | arch/cris/include/uapi/asm/socket.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/cris/include/uapi/asm/socket.h b/arch/cris/include/uapi/asm/socket.h index 13829aaaeec5..ed94e5ed0a23 100644 --- a/arch/cris/include/uapi/asm/socket.h +++ b/arch/cris/include/uapi/asm/socket.h @@ -80,6 +80,8 @@ #define SO_MAX_PACING_RATE 47 +#define SO_BPF_EXTENSIONS 48 + #endif /* _ASM_SOCKET_H */ |