2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-11-30 14:22:26 +00:00

Stop the address dump at a done message anywhere in the datagram

get_my_addresses only looked at the first netlink message of each
datagram for NLMSG_DONE. When the kernel sends the last addresses and
the done message in one datagram, as EL10 does for an IPv6 dump, the
loop waited for another datagram that never came. reply_dhcp6 asks for
the IPv6 addresses of the interface, so every DHCPv6 boot request went
unanswered.

A failed dump ends with an error message and no done message, so stop
at an error message too.
This commit is contained in:
Markus Hilger
2026-11-18 05:25:40 +01:00
parent c7ce6caae8
commit a8f18b6955
+2 -2
View File
@@ -132,10 +132,10 @@ async def get_my_addresses(idx=0, family=0, matchlla=None):
while True:
pdata = await asyncio.get_running_loop().sock_recv(s, 65536)
v = memoryview(pdata)
if struct.unpack('H', v[4:6])[0] == 3: # netlink done message
break
while len(v):
length, typ = struct.unpack('IH', v[:6])
if typ in (2, 3): # netlink error or done message
return addrs
if typ == 20:
fam, plen, _, scope, ridx = struct.unpack('BBBBI', v[nlhdrsz:nlhdrsz+ifaddrsz])
if matchlla: