You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Work-around while this fix is not available in the released pyrad packge
For now, I fixed the issue by overriding _AddSecret(...) to dynamically add a host when 0.0.0.0 was matched.
def_AddSecret(self, pkt):
ifpkt.source[0] inself.hosts:
pkt.secret=self.hosts[pkt.source[0]].secretelif'0.0.0.0'inself.hosts:
pkt.secret=self.hosts['0.0.0.0'].secret# The fix: dynamically add the actual host to the server's hosts list.self.hosts[pkt.source[0]] =self.hosts['0.0.0.0']
else:
raiseserver.ServerPacketError('Received packet from unknown host')
The text was updated successfully, but these errors were encountered:
The PR got merged, and will be part of the next release.
Since no release is done yet with the fix in it, I will keep this issue open until the release is done.
Till then, the work-around will have to be used.
When defining a client host
0.0.0.0
for a CoA radius Server, then a KeyError will occur when handling a CoA packet.The reason seems to be that
_AddSecret(...)
was added at some point to support using0.0.0.0
as a host, but thepkt.secret = ...
assignment that it ought to replace was not removed.I provided a fix in PR: #196
Work-around while this fix is not available in the released pyrad packge
For now, I fixed the issue by overriding
_AddSecret(...)
to dynamically add a host when0.0.0.0
was matched.The text was updated successfully, but these errors were encountered: