2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-11-19 08:52:20 +00:00

Merge pull request #395 from Obihoernchen/fix/neighutil-addr-done

Stop the address dump at a done message anywhere in the datagram
This commit is contained in:
Jarrod Johnson
2026-11-18 16:04:52 -05:00
committed by GitHub
+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: