Commit 97c9a18f authored by David Johnson's avatar David Johnson

Fix packing bug in ipv6addr nftables expr helper.

parent 509edfc5
...@@ -112,12 +112,12 @@ def ipv6addr(src=None, dst=None): ...@@ -112,12 +112,12 @@ def ipv6addr(src=None, dst=None):
if not src_mask: if not src_mask:
src_mask = '128' src_mask = '128'
src_mask = int('1' * int(src_mask), 2) src_mask = int('1' * int(src_mask), 2)
mask += struct.pack('QQ', src_mask) mask += struct.pack('QQ', src_mask & 0xffffffffffffffff, src_mask >> 64)
if dst: if dst:
if not dst_mask: if not dst_mask:
dst_mask = '128' dst_mask = '128'
dst_mask = int('1' * int(dst_mask), 2) dst_mask = int('1' * int(dst_mask), 2)
mask += struct.pack('QQ', dst_mask) mask += struct.pack('QQ', dst_mask & 0xffffffffffffffff, dst_mask >> 64)
xor = '\x00' * len(mask) xor = '\x00' * len(mask)
kwarg = OrderedDict() kwarg = OrderedDict()
kwarg['sreg'] = 1 # read from NFT_REG_1 kwarg['sreg'] = 1 # read from NFT_REG_1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment