Closed
Description
nft_rule_msg in netlink/nfnetlink/nftsocket.py no longer generates the correct netlink message.
#524 (specifically 254fc3e) changed nla array encoding so that the header type increments with each element.
The nfnetlink NFTA_RULE_EXPRESSIONS message requires that the header type remain as 1 for all elements in the array.
Following code should add a rule but doesn't.
import pyroute2
from pyroute2.nftables.expressions import ipv4addr, verdict
nft = pyroute2.NFTables()
nft.table('add', name='test0')
nft.chain('add', table='test0', name='test_chain0')
nft.rule('add',
table='test0',
chain='test_chain0',
expressions=(ipv4addr(src='192.168.0.0/24'),
verdict(code=1)))
Activity