From f8d414b4aec9a85df9d2d32239ed5832e1f9f6f8 Mon Sep 17 00:00:00 2001 From: Dominik Heidler Date: Sat, 4 Nov 2023 00:26:38 +0100 Subject: [PATCH] Ignore "Destination address required" error --- announce.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/announce.py b/announce.py index faad699..dd33ca6 100755 --- a/announce.py +++ b/announce.py @@ -30,7 +30,13 @@ while True: print(f"{UDP_IP}:{UDP_PORT} {MESSAGE=}" % MESSAGE) sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) sock.bind(('0.0.0.0', 1900)) # 1900 is SSDP src port - sock.sendto(MESSAGE, (UDP_IP, UDP_PORT)) + try: + sock.sendto(MESSAGE, (UDP_IP, UDP_PORT)) + except OSError: + # OSError: [Errno 89] Destination address required + # this error means that wireguard doesn't know an endpoint for this peer + # so we can ignore this error + pass sock.close() time.sleep(10)