Mask as part of element in set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have a set of pairs of MAC address and mask:

aa:bb:cc:dd:ee:ff 00:ff:ff:ff:ff:ff
aa:bb:cc:dd:ee:ff 00:ff:ff:ff:ff:00
...

I want to apply a mask to source MAC from the packet, and then compare
the result with the MAC from the pair. I can do it like so:

nft add table t
nft add chain t c
nft --debug=netlink add rule ip t c ether saddr and aa:bb:cc:dd:ee:ff
00:ff:ff:ff:ff:00

ip t c
  [ meta load iiftype => reg 1 ]
  [ cmp eq reg 1 0x00000001 ]
  [ payload load 6b @ link header + 6 => reg 1 ]
  [ bitwise reg 1 = (reg=1 & 0xddccbbaa 0x0000ffee ) ^ 0x00000000
0x00000000 ]
  [ cmp eq reg 1 0xffffff00 0x000000ff ]
...

But I have to create a new rule for each pair. Is there any
workarounds to use sets?




[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux