pyradius / pyrad

Python RADIUS Implementation
BSD 3-Clause "New" or "Revised" License
294 stars 186 forks source link

unhandled exception in client.py _SendPacket() #172

Open tedstockwell opened 2 years ago

tedstockwell commented 2 years ago

with pyrad 2.4, python 3.7, I've hit an exception from client.py _SendPacket(). If there's no route to the server (default route was not yet installed), socket.sendto() can raise an exception. _SendPacket() does not catch handle this.

I don't know if it should retry until timeout in this case or just be documented to call attention that exceptions like this are possible, in addition to Timeout.

    reply = self.srv.SendPacket(req)
  File "/home/admin/.local/lib/python3.7/site-packages/pyrad/client.py", line 194, in SendPacket
    reply = self._SendPacket(pkt, self.authport)
  File "/home/admin/.local/lib/python3.7/site-packages/pyrad/client.py", line 153, in _SendPacket
    self._socket.sendto(pkt.RequestPacket(), (self.server, port))
OSError: [Errno 101] Network is unreachable