Skip to content
Snippets Groups Projects
Commit 0f34d71b authored by Ondřej Surý's avatar Ondřej Surý Committed by Jan Včelák
Browse files

Add support for binding on non-local sockets on FreeBSD (IPV6_FREEBIND)

parent e90bc908
No related branches found
No related tags found
2 merge requests!330Knsupdate pubkey processing fix,!295Allow server to start before the interfaces are up
......@@ -88,6 +88,11 @@ int net_bound_socket(int type, const struct sockaddr_storage *ss)
(void) setsockopt(socket, IPPROTO_IP, IP_FREEBIND, &flag, sizeof(flag));
#endif
/* Allow bind to non-local address (FreeBSD) */
#ifdef IPV6_BINDANY
(void) setsockopt(socket, IPPROTO_IPV6, IPV6_BINDANY, &flag, sizeof(flag));
#endif
/* Bind to specified address. */
const struct sockaddr *sa = (const struct sockaddr *)ss;
int ret = bind(socket, sa, sockaddr_len(sa));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment