diff options
-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 | ||||
-rw-r--r-- | include/linux/filter.h | 11 | ||||
-rw-r--r-- | include/uapi/asm-generic/socket.h | 2 | ||||
-rw-r--r-- | net/core/sock.c | 4 |
16 files changed, 43 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 */ |
diff --git a/include/linux/filter.h b/include/linux/filter.h index ff4e40cd45b1..1a95a2dcf113 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -83,6 +83,17 @@ static inline void bpf_jit_free(struct sk_filter *fp) | |||
83 | #define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns) | 83 | #define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns) |
84 | #endif | 84 | #endif |
85 | 85 | ||
86 | static inline int bpf_tell_extensions(void) | ||
87 | { | ||
88 | /* When adding new BPF extension it is necessary to enumerate | ||
89 | * it here, so userspace software which wants to know what is | ||
90 | * supported can do so by inspecting return value of this | ||
91 | * function | ||
92 | */ | ||
93 | |||
94 | return 0; | ||
95 | } | ||
96 | |||
86 | enum { | 97 | enum { |
87 | BPF_S_RET_K = 1, | 98 | BPF_S_RET_K = 1, |
88 | BPF_S_RET_A, | 99 | BPF_S_RET_A, |
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h index 38f14d0264c3..ea0796bdcf88 100644 --- a/include/uapi/asm-generic/socket.h +++ b/include/uapi/asm-generic/socket.h | |||
@@ -80,4 +80,6 @@ | |||
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_GENERIC_SOCKET_H */ | 85 | #endif /* __ASM_GENERIC_SOCKET_H */ |
diff --git a/net/core/sock.c b/net/core/sock.c index b3f7ee3008a0..0c127dcdf6a8 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1167,6 +1167,10 @@ int sock_getsockopt(struct socket *sock, int level, int optname, | |||
1167 | v.val = sock_flag(sk, SOCK_FILTER_LOCKED); | 1167 | v.val = sock_flag(sk, SOCK_FILTER_LOCKED); |
1168 | break; | 1168 | break; |
1169 | 1169 | ||
1170 | case SO_BPF_EXTENSIONS: | ||
1171 | v.val = bpf_tell_extensions(); | ||
1172 | break; | ||
1173 | |||
1170 | case SO_SELECT_ERR_QUEUE: | 1174 | case SO_SELECT_ERR_QUEUE: |
1171 | v.val = sock_flag(sk, SOCK_SELECT_ERR_QUEUE); | 1175 | v.val = sock_flag(sk, SOCK_SELECT_ERR_QUEUE); |
1172 | break; | 1176 | break; |