aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2012-03-31 07:01:20 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-03 18:36:20 -0400
commitffe06c17afbbbd4d73cdc339419be232847d667a (patch)
treebfe1e55c86d317d9a4412e2d7da07f837265b066 /net/core
parent302d663740cfaf2c364df6bb61cd339014ed714c (diff)
filter: add XOR operation
Add XOR instruction fo BPF machine. Needed for computing packet hashes. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/filter.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index cfbea889a0eb..5099c4b4a53f 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -315,6 +315,9 @@ load_b:
315 case BPF_S_ANC_CPU: 315 case BPF_S_ANC_CPU:
316 A = raw_smp_processor_id(); 316 A = raw_smp_processor_id();
317 continue; 317 continue;
318 case BPF_S_ANC_ALU_XOR_X:
319 A ^= X;
320 continue;
318 case BPF_S_ANC_NLATTR: { 321 case BPF_S_ANC_NLATTR: {
319 struct nlattr *nla; 322 struct nlattr *nla;
320 323
@@ -559,6 +562,7 @@ int sk_chk_filter(struct sock_filter *filter, unsigned int flen)
559 ANCILLARY(HATYPE); 562 ANCILLARY(HATYPE);
560 ANCILLARY(RXHASH); 563 ANCILLARY(RXHASH);
561 ANCILLARY(CPU); 564 ANCILLARY(CPU);
565 ANCILLARY(ALU_XOR_X);
562 } 566 }
563 } 567 }
564 ftest->code = code; 568 ftest->code = code;