mirror of
https://github.com/MikeWang000000/Natter.git
synced 2025-12-24 11:51:05 +08:00
fix: Infinite EADDRNOTAVAIL loop when local IP changes
This commit is contained in:
@@ -1874,6 +1874,13 @@ def natter_main(show_title = True):
|
||||
try:
|
||||
keep_alive.keep_alive()
|
||||
except (OSError, socket.error) as ex:
|
||||
if hasattr(errno, "EADDRNOTAVAIL") and \
|
||||
ex.errno == errno.EADDRNOTAVAIL:
|
||||
if exit_when_changed:
|
||||
Logger.info("Natter is exiting because local IP address "
|
||||
"has changed")
|
||||
raise NatterExitException("Local IP address has changed")
|
||||
raise NatterRetryException("Local IP address has changed")
|
||||
if udp_mode:
|
||||
Logger.debug("keep-alive: UDP response not received: %s" % ex)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user