projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9ecf2fa
)
Use the IP_FREEBIND socket option, if defined
author
Fabian Keil
<fk@fabiankeil.de>
Mon, 18 Nov 2019 10:54:17 +0000
(11:54 +0100)
committer
Fabian Keil
<fk@fabiankeil.de>
Mon, 18 Nov 2019 11:20:57 +0000
(12:20 +0100)
This allows Privoxy to bind to not-yet assigned IP addresses
which is useful in failover environments.
Patch by Sam Varshavchik.
jbsockets.c
patch
|
blob
|
history
diff --git
a/jbsockets.c
b/jbsockets.c
index
625d830
..
ab2228a
100644
(file)
--- a/
jbsockets.c
+++ b/
jbsockets.c
@@
-1068,6
+1068,10
@@
int bind_port(const char *hostnam, int portnum, int backlog, jb_socket *pfd)
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one));
#endif /* ndef _WIN32 */
+#ifdef IP_FREEBIND
+ setsockopt(fd, IPPROTO_IP, IP_FREEBIND, (char *)&one, sizeof(one));
+#endif
+
#ifdef HAVE_RFC2553
if (bind(fd, rp->ai_addr, rp->ai_addrlen) < 0)
#else