]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add fallback to ns_client_get_type despite unreachable
authorAydın Mercan <aydin@isc.org>
Wed, 7 Feb 2024 08:35:59 +0000 (11:35 +0300)
committerAydın Mercan <aydin@isc.org>
Fri, 26 Apr 2024 13:12:29 +0000 (16:12 +0300)
GCC might fail to compile because it expects a return after UNREACHABLE.
It should ideally just work anyway since UNREACHABLE is either a
noreturn or UB (__builtin_unreachable / C23 unreachable).

Either way, it should be optimized almost always so the fallback is
free or basically free anyway when it isn't optimized out.

lib/ns/client.c

index b129db00c371fa6c5effb5fa08178444186c47d5..04447397af79b169411771fc2e4ef3ac8f8d6037 100644 (file)
@@ -155,6 +155,8 @@ ns_client_transport_type(const ns_client_t *client) {
        case isc_nm_nonesocket:
                UNREACHABLE();
        }
+
+       return DNS_TRANSPORT_UDP;
 }
 
 void