diff options
author | Michal Sekletar <msekleta@redhat.com> | 2014-01-17 11:09:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-18 22:08:58 -0500 |
commit | ea02f9411d9faa3553ed09ce0ec9f00ceae9885e (patch) | |
tree | c058c0f3060402a8778ed077f7dc092e62fc0958 /arch | |
parent | 41804420586ab41049a14ab7ef04eaa2280b8647 (diff) |
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')
-rw-r--r-- | arch/alpha/include/uapi/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/avr32/include/uapi/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/cris/include/uapi/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/frv/include/uapi/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/ia64/include/uapi/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/m32r/include/uapi/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/mips/include/uapi/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/mn10300/include/uapi/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/parisc/include/uapi/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/uapi/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/s390/include/uapi/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/sparc/include/uapi/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/xtensa/include/uapi/asm/socket.h | 2 |
13 files changed, 26 insertions, 0 deletions
diff --git a/arch/alpha/include/uapi/asm/socket.h b/arch/alpha/include/uapi/asm/socket.h index e3a1491d5073..3de1394bcab8 100644 --- a/arch/alpha/include/uapi/asm/socket.h +++ b/arch/alpha/include/uapi/asm/socket.h | |||
@@ -85,4 +85,6 @@ | |||
85 | 85 | ||
86 | #define SO_MAX_PACING_RATE 47 | 86 | #define SO_MAX_PACING_RATE 47 |
87 | 87 | ||
88 | #define SO_BPF_EXTENSIONS 48 | ||
89 | |||
88 | #endif /* _UAPI_ASM_SOCKET_H */ | 90 | #endif /* _UAPI_ASM_SOCKET_H */ |
diff --git a/arch/avr32/include/uapi/asm/socket.h b/arch/avr32/include/uapi/asm/socket.h index cbf902e4cd9e..6e6cd159924b 100644 --- a/arch/avr32/include/uapi/asm/socket.h +++ b/arch/avr32/include/uapi/asm/socket.h | |||
@@ -78,4 +78,6 @@ | |||
78 | 78 | ||
79 | #define SO_MAX_PACING_RATE 47 | 79 | #define SO_MAX_PACING_RATE 47 |
80 | 80 | ||
81 | #define SO_BPF_EXTENSIONS 48 | ||
82 | |||
81 | #endif /* _UAPI__ASM_AVR32_SOCKET_H */ | 83 | #endif /* _UAPI__ASM_AVR32_SOCKET_H */ |
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 @@ | |||
80 | 80 | ||
81 | #define SO_MAX_PACING_RATE 47 | 81 | #define SO_MAX_PACING_RATE 47 |
82 | 82 | ||
83 | #define SO_BPF_EXTENSIONS 48 | ||
84 | |||
83 | #endif /* _ASM_SOCKET_H */ | 85 | #endif /* _ASM_SOCKET_H */ |
84 | 86 | ||
85 | 87 | ||
diff --git a/arch/frv/include/uapi/asm/socket.h b/arch/frv/include/uapi/asm/socket.h index 5d4299762426..ca2c6e6f31c6 100644 --- a/arch/frv/include/uapi/asm/socket.h +++ b/arch/frv/include/uapi/asm/socket.h | |||
@@ -78,5 +78,7 @@ | |||
78 | 78 | ||
79 | #define SO_MAX_PACING_RATE 47 | 79 | #define SO_MAX_PACING_RATE 47 |
80 | 80 | ||
81 | #define SO_BPF_EXTENSIONS 48 | ||
82 | |||
81 | #endif /* _ASM_SOCKET_H */ | 83 | #endif /* _ASM_SOCKET_H */ |
82 | 84 | ||
diff --git a/arch/ia64/include/uapi/asm/socket.h b/arch/ia64/include/uapi/asm/socket.h index c25302fb48d9..a1b49bac7951 100644 --- a/arch/ia64/include/uapi/asm/socket.h +++ b/arch/ia64/include/uapi/asm/socket.h | |||
@@ -87,4 +87,6 @@ | |||
87 | 87 | ||
88 | #define SO_MAX_PACING_RATE 47 | 88 | #define SO_MAX_PACING_RATE 47 |
89 | 89 | ||
90 | #define SO_BPF_EXTENSIONS 48 | ||
91 | |||
90 | #endif /* _ASM_IA64_SOCKET_H */ | 92 | #endif /* _ASM_IA64_SOCKET_H */ |
diff --git a/arch/m32r/include/uapi/asm/socket.h b/arch/m32r/include/uapi/asm/socket.h index 52966650114f..6c9a24b3aefa 100644 --- a/arch/m32r/include/uapi/asm/socket.h +++ b/arch/m32r/include/uapi/asm/socket.h | |||
@@ -78,4 +78,6 @@ | |||
78 | 78 | ||
79 | #define SO_MAX_PACING_RATE 47 | 79 | #define SO_MAX_PACING_RATE 47 |
80 | 80 | ||
81 | #define SO_BPF_EXTENSIONS 48 | ||
82 | |||
81 | #endif /* _ASM_M32R_SOCKET_H */ | 83 | #endif /* _ASM_M32R_SOCKET_H */ |
diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h index 0df9787cd84d..a14baa218c76 100644 --- a/arch/mips/include/uapi/asm/socket.h +++ b/arch/mips/include/uapi/asm/socket.h | |||
@@ -96,4 +96,6 @@ | |||
96 | 96 | ||
97 | #define SO_MAX_PACING_RATE 47 | 97 | #define SO_MAX_PACING_RATE 47 |
98 | 98 | ||
99 | #define SO_BPF_EXTENSIONS 48 | ||
100 | |||
99 | #endif /* _UAPI_ASM_SOCKET_H */ | 101 | #endif /* _UAPI_ASM_SOCKET_H */ |
diff --git a/arch/mn10300/include/uapi/asm/socket.h b/arch/mn10300/include/uapi/asm/socket.h index 71dedcae55a6..6aa3ce1854aa 100644 --- a/arch/mn10300/include/uapi/asm/socket.h +++ b/arch/mn10300/include/uapi/asm/socket.h | |||
@@ -78,4 +78,6 @@ | |||
78 | 78 | ||
79 | #define SO_MAX_PACING_RATE 47 | 79 | #define SO_MAX_PACING_RATE 47 |
80 | 80 | ||
81 | #define SO_BPF_EXTENSIONS 48 | ||
82 | |||
81 | #endif /* _ASM_SOCKET_H */ | 83 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h index 70b3674dac4e..fe35ceacf0e7 100644 --- a/arch/parisc/include/uapi/asm/socket.h +++ b/arch/parisc/include/uapi/asm/socket.h | |||
@@ -77,4 +77,6 @@ | |||
77 | 77 | ||
78 | #define SO_MAX_PACING_RATE 0x4028 | 78 | #define SO_MAX_PACING_RATE 0x4028 |
79 | 79 | ||
80 | #define SO_BPF_EXTENSIONS 0x4029 | ||
81 | |||
80 | #endif /* _UAPI_ASM_SOCKET_H */ | 82 | #endif /* _UAPI_ASM_SOCKET_H */ |
diff --git a/arch/powerpc/include/uapi/asm/socket.h b/arch/powerpc/include/uapi/asm/socket.h index fa698324a1fd..a9c3e2e18c05 100644 --- a/arch/powerpc/include/uapi/asm/socket.h +++ b/arch/powerpc/include/uapi/asm/socket.h | |||
@@ -85,4 +85,6 @@ | |||
85 | 85 | ||
86 | #define SO_MAX_PACING_RATE 47 | 86 | #define SO_MAX_PACING_RATE 47 |
87 | 87 | ||
88 | #define SO_BPF_EXTENSIONS 48 | ||
89 | |||
88 | #endif /* _ASM_POWERPC_SOCKET_H */ | 90 | #endif /* _ASM_POWERPC_SOCKET_H */ |
diff --git a/arch/s390/include/uapi/asm/socket.h b/arch/s390/include/uapi/asm/socket.h index c286c2e868f0..e031332096d7 100644 --- a/arch/s390/include/uapi/asm/socket.h +++ b/arch/s390/include/uapi/asm/socket.h | |||
@@ -84,4 +84,6 @@ | |||
84 | 84 | ||
85 | #define SO_MAX_PACING_RATE 47 | 85 | #define SO_MAX_PACING_RATE 47 |
86 | 86 | ||
87 | #define SO_BPF_EXTENSIONS 48 | ||
88 | |||
87 | #endif /* _ASM_SOCKET_H */ | 89 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h index 0f21e9a5ca18..54d9608681b6 100644 --- a/arch/sparc/include/uapi/asm/socket.h +++ b/arch/sparc/include/uapi/asm/socket.h | |||
@@ -74,6 +74,8 @@ | |||
74 | 74 | ||
75 | #define SO_MAX_PACING_RATE 0x0031 | 75 | #define SO_MAX_PACING_RATE 0x0031 |
76 | 76 | ||
77 | #define SO_BPF_EXTENSIONS 0x0032 | ||
78 | |||
77 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | 79 | /* Security levels - as per NRL IPv6 - don't actually do anything */ |
78 | #define SO_SECURITY_AUTHENTICATION 0x5001 | 80 | #define SO_SECURITY_AUTHENTICATION 0x5001 |
79 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 | 81 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 |
diff --git a/arch/xtensa/include/uapi/asm/socket.h b/arch/xtensa/include/uapi/asm/socket.h index 7db5c22faa68..39acec0cf0b1 100644 --- a/arch/xtensa/include/uapi/asm/socket.h +++ b/arch/xtensa/include/uapi/asm/socket.h | |||
@@ -89,4 +89,6 @@ | |||
89 | 89 | ||
90 | #define SO_MAX_PACING_RATE 47 | 90 | #define SO_MAX_PACING_RATE 47 |
91 | 91 | ||
92 | #define SO_BPF_EXTENSIONS 48 | ||
93 | |||
92 | #endif /* _XTENSA_SOCKET_H */ | 94 | #endif /* _XTENSA_SOCKET_H */ |