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/tcp.c:468:15: warning: The 1st argument to 'dup' is -1 but should be >= 0 [unix.StdCLibraryFunctions]
Assisted-by: Claude:claude-opus-4-8
UNUSED(fd);
csock->fd = isc__nm_tcp_lb_socket(iface->type.sa.sa_family);
} else {
+ REQUIRE(fd >= 0);
csock->fd = dup(fd);
}
REQUIRE(csock->fd >= 0);