forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 aa1113d ("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 <[email protected]> Cc: David Miller <[email protected]> Reviewed-by: Daniel Borkmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
- Loading branch information
Showing
16 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,4 +85,6 @@ | |
|
||
#define SO_MAX_PACING_RATE 47 | ||
|
||
#define SO_BPF_EXTENSIONS 48 | ||
|
||
#endif /* _UAPI_ASM_SOCKET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,4 +78,6 @@ | |
|
||
#define SO_MAX_PACING_RATE 47 | ||
|
||
#define SO_BPF_EXTENSIONS 48 | ||
|
||
#endif /* _UAPI__ASM_AVR32_SOCKET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,8 @@ | |
|
||
#define SO_MAX_PACING_RATE 47 | ||
|
||
#define SO_BPF_EXTENSIONS 48 | ||
|
||
#endif /* _ASM_SOCKET_H */ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,5 +78,7 @@ | |
|
||
#define SO_MAX_PACING_RATE 47 | ||
|
||
#define SO_BPF_EXTENSIONS 48 | ||
|
||
#endif /* _ASM_SOCKET_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,4 +87,6 @@ | |
|
||
#define SO_MAX_PACING_RATE 47 | ||
|
||
#define SO_BPF_EXTENSIONS 48 | ||
|
||
#endif /* _ASM_IA64_SOCKET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,4 +78,6 @@ | |
|
||
#define SO_MAX_PACING_RATE 47 | ||
|
||
#define SO_BPF_EXTENSIONS 48 | ||
|
||
#endif /* _ASM_M32R_SOCKET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,4 +96,6 @@ | |
|
||
#define SO_MAX_PACING_RATE 47 | ||
|
||
#define SO_BPF_EXTENSIONS 48 | ||
|
||
#endif /* _UAPI_ASM_SOCKET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,4 +78,6 @@ | |
|
||
#define SO_MAX_PACING_RATE 47 | ||
|
||
#define SO_BPF_EXTENSIONS 48 | ||
|
||
#endif /* _ASM_SOCKET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,4 +77,6 @@ | |
|
||
#define SO_MAX_PACING_RATE 0x4028 | ||
|
||
#define SO_BPF_EXTENSIONS 0x4029 | ||
|
||
#endif /* _UAPI_ASM_SOCKET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,4 +85,6 @@ | |
|
||
#define SO_MAX_PACING_RATE 47 | ||
|
||
#define SO_BPF_EXTENSIONS 48 | ||
|
||
#endif /* _ASM_POWERPC_SOCKET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,4 +84,6 @@ | |
|
||
#define SO_MAX_PACING_RATE 47 | ||
|
||
#define SO_BPF_EXTENSIONS 48 | ||
|
||
#endif /* _ASM_SOCKET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,4 +89,6 @@ | |
|
||
#define SO_MAX_PACING_RATE 47 | ||
|
||
#define SO_BPF_EXTENSIONS 48 | ||
|
||
#endif /* _XTENSA_SOCKET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,4 +80,6 @@ | |
|
||
#define SO_MAX_PACING_RATE 47 | ||
|
||
#define SO_BPF_EXTENSIONS 48 | ||
|
||
#endif /* __ASM_GENERIC_SOCKET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters