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

IPRoute decoding exceptions on linux kernel 6.6 (IFLA_INET6_ADDR_GEN_MODE) #1166

Open
liske opened this issue Feb 1, 2024 · 1 comment
Open
Labels

Comments

@liske
Copy link
Contributor

liske commented Feb 1, 2024

(Sorry the original issue description was almost wrong due to a mixture of:

  • a race condition in ifstate were two processes have used the same netlink socket in their IPRoute instances resulting in corrupted netlink messages
  • /me seeing a ipv6 address related decoding error... while having in mind that there was a new protocol attribute for ip addresses in recent linux kernel releases 🤦 )

Here is the dump for IPRoute.get_addr() on linux 6.6 having a link-local address from SLAAC and a manually configured one:

 {'attrs': [('IFA_ADDRESS', 'fe80::290:bff:fea0:f19d'),
            ('IFA_CACHEINFO', {'ifa_preferred': 4294967295, 'ifa_valid': 4294967295, 'cstamp': 92517, 'tstamp': 92517}),
            ('IFA_FLAGS', 128),
            ('UNKNOWN', {'header': {'length': 5, 'type': 11}})],
  'event': 'RTM_NEWADDR',
  'family': 10,
  'flags': 128,
  'header': {'error': None,
             'flags': 2,
             'length': 80,
             'pid': 15390,
             'sequence_number': 259,
             'stats': Stats(qsize=0, delta=0, delay=0),
             'target': 'localhost',
             'type': 20},
  'index': 46,
  'prefixlen': 64,
  'scope': 253},
 {'attrs': [('IFA_ADDRESS', 'fe80::defa'),
            ('IFA_CACHEINFO', {'ifa_preferred': 4294967295, 'ifa_valid': 4294967295, 'cstamp': 89555, 'tstamp': 89555}),
            ('IFA_FLAGS', 128)],
  'event': 'RTM_NEWADDR',
  'family': 10,
  'flags': 128,
  'header': {'error': None,
             'flags': 2,
             'length': 72,
             'pid': 15390,
             'sequence_number': 259,
             'stats': Stats(qsize=0, delta=0, delay=0),
             'target': 'localhost',
             'type': 20},
  'index': 46,
  'prefixlen': 64,
  'scope': 253})

The unknown header is the proto attribute, isn't it?

# ip -d addr show dev vlan2 | tail -n 4
    inet6 fe80::290:bff:fea0:f19d/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever
    inet6 fe80::defa/64 scope link 
       valid_lft forever preferred_lft forever
@svinota svinota added the bug label Feb 1, 2024
@svinota
Copy link
Owner

svinota commented Feb 1, 2024

Thanks for the report, investigating!

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