retry port allocation on all errors, not just EADDRINUSE; ok jakob@
authordjm <djm@openbsd.org>
Thu, 10 Jul 2008 07:42:14 +0000 (07:42 +0000)
committerdjm <djm@openbsd.org>
Thu, 10 Jul 2008 07:42:14 +0000 (07:42 +0000)
usr.sbin/bind/lib/dns/dispatch.c

index 99d5b93..341798e 100644 (file)
@@ -1933,7 +1933,7 @@ dispatch_createudp(dns_dispatchmgr_t *mgr, isc_socketmgr_t *sockmgr,
 
                isc_sockaddr_setport(&localaddr_bound, 0);
                result = create_socket(sockmgr, &localaddr_bound, &sock);
-               if (result == ISC_R_ADDRINUSE) {
+               if (result != ISC_R_SUCCESS) {
                        if (++k == 1024)
                                attributes &= ~DNS_DISPATCHATTR_RANDOMPORT;
                        goto getsocket;