mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-30 19:39:34 -05:00
Merge branch 'IP_BIND_ADDRESS_NO_PORT' of https://github.com/crrodriguez/unbound into crrodriguez-IP_BIND_ADDRESS_NO_PORT
This commit is contained in:
commit
0f4c4c1163
1 changed files with 3 additions and 0 deletions
|
|
@ -247,6 +247,9 @@ pick_outgoing_tcp(struct pending_tcp* pend, struct waiting_tcp* w, int s)
|
|||
if(addr_is_ip6(&pi->addr, pi->addrlen))
|
||||
((struct sockaddr_in6*)&pi->addr)->sin6_port = 0;
|
||||
else ((struct sockaddr_in*)&pi->addr)->sin_port = 0;
|
||||
#ifdef IP_BIND_ADDRESS_NO_PORT
|
||||
setsockopt(s, SOL_IP, IP_BIND_ADDRESS_NO_PORT, &(int) {1}, sizeof(int));
|
||||
#endif
|
||||
if(bind(s, (struct sockaddr*)&pi->addr, pi->addrlen) != 0) {
|
||||
#ifndef USE_WINSOCK
|
||||
#ifdef EADDRNOTAVAIL
|
||||
|
|
|
|||
Loading…
Reference in a new issue