Closed
Description
Reproduce steps:
First let's create the clsact qdisc and a bpf filter.
ipr.tc("add", "clsact", 1) # dev lo
ipr.tc(
"add-filter",
"bpf",
1, # dev lo
":1",
fd=func.fd,
name=func.name,
parent='ffff:fff2',
classid=1,
direct_action=True,
)
Then we can check the status:
$ tc filter show dev lo parent ffff:fff2
filter protocol all pref 49152 bpf chain 0
filter protocol all pref 49152 bpf chain 0 handle 0x1 flowid :1 tc_pass direct-action not_in_hw id 329 tag 15858a412926acbb
However the consequent del-filter won't work:
ipr.tc("del-filter", "bpf", iface_idx, ':1', parent='ffff:fff2')
will raise error
Traceback (most recent call last):
File "basic01-xdp-pass/tc_loader.bcc.py", line 45, in <module>
ipr.tc("del-filter", "bpf", iface_idx, ':0', parent=parent)
File "/usr/lib/python3/dist-packages/pyroute2/iproute/linux.py", line 1614, in tc
return tuple(self.nlm_request(msg, msg_type=command, msg_flags=flags))
File "/usr/lib/python3/dist-packages/pyroute2/netlink/nlsocket.py", line 376, in nlm_request
return tuple(self._genlm_request(*argv, **kwarg))
File "/usr/lib/python3/dist-packages/pyroute2/netlink/nlsocket.py", line 867, in nlm_request
for msg in self.get(msg_seq=msg_seq,
File "/usr/lib/python3/dist-packages/pyroute2/netlink/nlsocket.py", line 379, in get
return tuple(self._genlm_get(*argv, **kwarg))
File "/usr/lib/python3/dist-packages/pyroute2/netlink/nlsocket.py", line 704, in get
raise msg['header']['error']
pyroute2.netlink.exceptions.NetlinkError: (2, 'No such file or directory')
I guess it's caused by tcm_info
in the request of RTM_DELTFILTER, somehow the parameter is set to 0x300 instead of 0, but I don't know how to make the correction.
Activity