Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing of TCA_EMATCH_TREE_LIST is broken #1248

Open
ffourcot opened this issue Jan 14, 2025 · 2 comments
Open

Parsing of TCA_EMATCH_TREE_LIST is broken #1248

ffourcot opened this issue Jan 14, 2025 · 2 comments
Labels

Comments

@ffourcot
Copy link
Collaborator

DEBUG get(): message {'attrs': [('TCA_KIND', 'basic'), ('UNKNOWN', {'header': {'length': 8, 'type': 11}}), ('TCA_OPTIONS', {'attrs': [('TCA_BASIC_CLASSID', 65536), ('UNKNOWN', {'header': {'length': 20, 'type': 5}}), ('TCA_BASIC_ACT', {'attrs': [('TCA_ACT_PRIO_1', {'attrs': [('TCA_ACT_KIND', 'skbedit'), ('TCA_ACT_STATS', {'attrs': [('TCA_STATS_BASIC', {'bytes': 0, 'packets': 0}), ('UNKNOWN', {'header': {'length': 20, 'type': 7}}), ('TCA_STATS_QUEUE', {'qlen': 0, 'backlog': 0, 'drops': 0, 'requeues': 0, 'overlimits': 0})]}), ('TCA_ACT_OPTIONS', {'attrs': [('TCA_SKBEDIT_PARMS', {'index': 1, 'capab': 0, 'action': 3, 'refcnt': 1, 'bindcnt': 1}), ('TCA_SKBEDIT_PRIORITY', 65539), ('TCA_SKBEDIT_TM', {'install': 14, 'lastuse': 14, 'expires': 0, 'firstuse': 0})]})]})]}), ('TCA_BASIC_EMATCHES', {'attrs': [('TCA_EMATCH_TREE_HDR', {'nmatches': 1, 'progid': 0}), ('TCA_EMATCH_TREE_LIST', b'\x14\x00\x02\x00\x10\x00\x01\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x01\x02')]})]})], 'header': {'length': 280, 'type': 44, 'flags': 2, 'sequence_number': 256, 'pid': 2849249314, 'error': None}, 'family': 0, 'pad1': 0, 'pad2': 0, 'index': 10, 'handle': 1, 'parent': 65536, 'info': 66304, 'event': 'RTM_NEWTFILTER'}
2025-01-14 15:41:08,384 /root/.local/lib/python3.11/site-packages/pytest/__main__.py:1797[wibox/10/]: WARNING try_to_decode(): decoding TCA_EMATCH_TREE_LIST
2025-01-14 15:41:08,385 /root/.local/lib/python3.11/site-packages/pytest/__main__.py:1798[wibox/10/]: WARNING try_to_decode(): Traceback (most recent call last):
  File "pyroute2/netlink/__init__.py", line 1794, in try_to_decode
    cell.decode()
  File "pyroute2/netlink/rtnl/tcmsg/cls_basic.py", line 216, in decode
    nla.decode(self)
  File "pyroute2/netlink/__init__.py", line 2374, in decode
    nla_base.decode(self)
  File "pyroute2/netlink/__init__.py", line 1172, in decode
    cell.decode()
  File "pyroute2/netlink/rtnl/tcmsg/cls_basic.py", line 227, in decode
    self['opt'] = self.parse_ematch_options(self, data)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pyroute2/netlink/rtnl/tcmsg/common_ematch.py", line 53, in parse_ematch_options
    ret.decode()
  File "pyroute2/netlink/__init__.py", line 1176, in decode
    self.ft_decode(offset)
    ^^^^^^^^^^^^^^
AttributeError: 'data' object has no attribute 'ft_decode'

I do not have a simple "how to reproduce" for now, tell me if you need more details

@svinota svinota added the bug label Jan 14, 2025
@svinota
Copy link
Owner

svinota commented Jan 14, 2025

Expect the fix latest on Friday.

Sorry for being late with that.

@svinota
Copy link
Owner

svinota commented Jan 20, 2025

Nope, it takes too much time to reproduce, rebuilding the message from the struct above. May I ask you to send me the binary packet data from the first line?

Either put there logging to dump msg.data or like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants