Skip to content

Commit eb74634

Browse files
Your NameGIC-de
Your Name
authored andcommitted
Fix KeyError in _HandleCoaPacket for 0.0.0.0 host
When defining a client host `0.0.0.0` for a CoA radius Server, then a KeyError will occur when handling a CoA packet. File ".../pyrad/server.py", line 250, in _HandleCoaPacket pkt.secret = self.hosts[pkt.source[0]].secret ~~~~~~~~~~^^^^^^^^^^^^^^^ KeyError: '172.16.0.100' The reason seems to be that _AddSecret() was added at some point to support using `0.0.0.0` as a host, but the `pkt.secret = ...` assignment that it ought to replace was not removed. This patch fixes the behavior by removing the stale assignment.
1 parent 3d9cff1 commit eb74634

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

pyrad/server.py

-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ def _HandleCoaPacket(self, pkt):
247247
:type pkt: Packet class instance
248248
"""
249249
self._AddSecret(pkt)
250-
pkt.secret = self.hosts[pkt.source[0]].secret
251250
if pkt.code == packet.CoARequest:
252251
self.HandleCoaPacket(pkt)
253252
elif pkt.code == packet.DisconnectRequest:

0 commit comments

Comments
 (0)