]> git.ipfire.org Git - ddns.git/commitdiff
system: Catch exception when host is not dual-stacked
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Apr 2022 09:33:46 +0000 (10:33 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Apr 2022 09:33:46 +0000 (10:33 +0100)
This problem seems to have been introduced with an upgrade to Python
3.10.

Reported-by: Adrian Zaugg <ipfire.org@mailgurgler.com>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/ddns/system.py

index 73a27a5cd0b56484feda70006b3ba4065e11e0c8..48c9a8f88fdde2b922cb6548e450c9a1407851fb 100644 (file)
@@ -226,8 +226,12 @@ class DDNSSystem(object):
                                if e.reason.errno == -2:
                                        raise DDNSResolveError
 
                                if e.reason.errno == -2:
                                        raise DDNSResolveError
 
+                               # Cannot assign requested address
+                               elif e.reason.errno == 99:
+                                       raise DDNSNetworkUnreachableError
+
                                # Network Unreachable (e.g. no IPv6 access)
                                # Network Unreachable (e.g. no IPv6 access)
-                               if e.reason.errno == 101:
+                               elif e.reason.errno == 101:
                                        raise DDNSNetworkUnreachableError
 
                                # Connection Refused
                                        raise DDNSNetworkUnreachableError
 
                                # Connection Refused