mirror of
https://github.com/xcat2/confluent.git
synced 2026-09-11 12:06:26 +00:00
Restore proxyDHCP log throttling
The per-MAC 90 second log throttle in proxydhcp has been inert: the `skiplogging = True` reset sat in relay_proxydhcp, where it is a dead local, while the loop in proxydhcp only ever assigns False. Once the first packet is handled the flag stays False for the life of the process, so every retransmitted boot request logs again even though ignoredisco is updated to suppress it. Reset the flag at the top of each loop iteration instead, next to the timestamp check it belongs to, and drop the dead assignment.
This commit is contained in:
@@ -279,7 +279,6 @@ def relay_proxydhcp(sock, pktq):
|
||||
elif disco.get('uuid', None) in uuidmap:
|
||||
node = uuidmap[disco['uuid']]
|
||||
myipn = myipbypeer.get(data[28:28+hwlen], None)
|
||||
skiplogging = True
|
||||
pktq.put_nowait((disco, peer, myipn, idx, recv, node, opts, data))
|
||||
|
||||
|
||||
@@ -296,6 +295,7 @@ async def proxydhcp(handler, nodeguess):
|
||||
try:
|
||||
disco, client, myipn, idx, recv, node, opts, data = await pktq.get()
|
||||
netaddr = disco['hwaddr']
|
||||
skiplogging = True
|
||||
if time.time() > ignoredisco.get(netaddr, 0) + 90:
|
||||
skiplogging = False
|
||||
ignoredisco[netaddr] = time.time()
|
||||
|
||||
Reference in New Issue
Block a user