mirror of
https://github.com/xcat2/confluent.git
synced 2026-01-11 18:42:29 +00:00
Handle NLMSG_DONE wherever it may appear in reply
Some kernels may bundle the NLMSG_DONE in the last useful system call, unlike the previous norm of sending it as a single message in a terminating system call.
This commit is contained in:
@@ -48,14 +48,15 @@ def _update_neigh():
|
||||
ndmsg= b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
s.sendall(nlhdr + ndmsg)
|
||||
neightable = {}
|
||||
inprogress = True
|
||||
try:
|
||||
while True:
|
||||
while inprogress:
|
||||
pdata = s.recv(65536)
|
||||
v = memoryview(pdata)
|
||||
if struct.unpack('H', v[4:6])[0] == 3:
|
||||
break
|
||||
while len(v):
|
||||
length, typ = struct.unpack('IH', v[:6])
|
||||
if typ == 3:
|
||||
inprogress = False
|
||||
if typ == 28:
|
||||
hlen = struct.calcsize('BIHBB')
|
||||
_, idx, state, flags, typ = struct.unpack('BIHBB', v[16:16+hlen])
|
||||
|
||||
Reference in New Issue
Block a user