]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
wrap ns_nm_socket_type for testing
authorEvan Hunt <each@isc.org>
Thu, 10 Oct 2024 06:16:26 +0000 (23:16 -0700)
committerAydın Mercan <aydin@isc.org>
Mon, 25 Nov 2024 10:07:24 +0000 (13:07 +0300)
The testing ns_client doesn't have a proper nmhandle.

tests/ns/netmgr_wrap.c

index 725392fc5a848b8ced2098691c1dcb0ee8b33038..2adca9730321f1e0c07ca01396fc98ee015abbd7 100644 (file)
@@ -97,3 +97,15 @@ isc_nmhandle_detach(isc_nmhandle_t **handlep) {
 
        return;
 }
+
+isc_nmsocket_type
+isc_nm_socket_type(const isc_nmhandle_t *handle ISC_ATTR_UNUSED) {
+       /*
+        * By arbitrary choice, we treat mock handles as if
+        * they were always for UDP sockets. If it's necessary
+        * to test with other socket types in the future, this
+        * could be changed to a global variable rather than a
+        * constant.
+        */
+       return isc_nm_udpsocket;
+}