diff options
author | Daniel Borkmann <dxchgb@gmail.com> | 2012-09-23 22:23:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-24 16:49:21 -0400 |
commit | 9e49e88958feb41ec701fa34b44723dabadbc28c (patch) | |
tree | ab17d7738505ade25a0a16bf442086cbf07d0f22 /include | |
parent | 718cffc4ac65f01c6f1efd6baec8b4b5ff0c76b5 (diff) |
filter: add XOR instruction for use with X/K
SKF_AD_ALU_XOR_X has been added a while ago, but as an 'ancillary'
operation that is invoked through a negative offset in K within BPF
load operations. Since BPF_MOD has recently been added, BPF_XOR should
also be part of the common ALU operations. Removing SKF_AD_ALU_XOR_X
might not be an option since this is exposed to user space.
Signed-off-by: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/filter.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index 3cf5fd561d86..2ded090e10f4 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -75,6 +75,7 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */ | |||
75 | #define BPF_RSH 0x70 | 75 | #define BPF_RSH 0x70 |
76 | #define BPF_NEG 0x80 | 76 | #define BPF_NEG 0x80 |
77 | #define BPF_MOD 0x90 | 77 | #define BPF_MOD 0x90 |
78 | #define BPF_XOR 0xa0 | ||
78 | 79 | ||
79 | #define BPF_JA 0x00 | 80 | #define BPF_JA 0x00 |
80 | #define BPF_JEQ 0x10 | 81 | #define BPF_JEQ 0x10 |
@@ -204,6 +205,8 @@ enum { | |||
204 | BPF_S_ALU_AND_X, | 205 | BPF_S_ALU_AND_X, |
205 | BPF_S_ALU_OR_K, | 206 | BPF_S_ALU_OR_K, |
206 | BPF_S_ALU_OR_X, | 207 | BPF_S_ALU_OR_X, |
208 | BPF_S_ALU_XOR_K, | ||
209 | BPF_S_ALU_XOR_X, | ||
207 | BPF_S_ALU_LSH_K, | 210 | BPF_S_ALU_LSH_K, |
208 | BPF_S_ALU_LSH_X, | 211 | BPF_S_ALU_LSH_X, |
209 | BPF_S_ALU_RSH_K, | 212 | BPF_S_ALU_RSH_K, |