Commit c2540027 authored by David Johnson's avatar David Johnson

Add nftable chain hook priority, including negative high-prio for u32 enc.

parent 4174f5c6
......@@ -78,9 +78,15 @@ class NFTables(NFTSocket):
'output': 3,
'postrouting': 4}
if 'hook' in kwarg:
if 'priority' in kwarg:
prio = kwarg['priority']
if prio < 0:
prio += 2**32
prio = 0
kwarg['hook'] = {'attrs':
[['NFTA_HOOK_HOOKNUM', hooks[kwarg['hook']]],
if 'type' not in kwarg:
kwarg['type'] = 'filter'
return self._command(nft_chain_msg, commands, cmd, kwarg)
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