load_balance_sockets is fixed at netmgr init, so dup(fd) runs only when
the caller supplied a valid descriptor. Assert it to silence a
scan-build false positive:
lib/isc/netmgr/udp.c:194:15: warning: The 1st argument to 'dup' is -1 but should be >= 0 [unix.StdCLibraryFunctions]
Assisted-by: Claude:claude-opus-4-8
if (isc__netmgr->load_balance_sockets) {
csock->fd = isc__nm_udp_lb_socket(iface->type.sa.sa_family);
} else {
+ INSIST(fd >= 0);
csock->fd = dup(fd);
}
INSIST(csock->fd >= 0);