aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJonh Wendell <jonh.wendell@vexcorp.com>2012-02-09 15:14:33 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2012-02-09 15:14:33 +0100
commit9106107a509cfb23806e46765ea2704cdd130654 (patch)
treedbc6ac28d378479b3b841c763e9b1c4bd49e9ef9 /include
parent638dbc34b3dd2a6e340a2370056913ed5770d196 (diff)
downloadbusybox-w32-9106107a509cfb23806e46765ea2704cdd130654.tar.gz
busybox-w32-9106107a509cfb23806e46765ea2704cdd130654.tar.bz2
busybox-w32-9106107a509cfb23806e46765ea2704cdd130654.zip
Make unix (local) sockets work without IPv6 enabled
The xsocket_type() function had an optional "family" argument that was enabled only if IPv6 is enabled. In the case of the function was called with a valid AF_UNIX argument, and IPv6 is disabled, this argument was silently ignored. This patch makes the "family" argument mandatory, while keeping the old behavior i.e., if AF_UNSPEC is passed, we try first IPv6 (if it's enabled) and fallback to IPv4. Also I changed all callers of xsocket_type() to reflect its new interface. Signed-off-by: Jonh Wendell <jonh.wendell@vexcorp.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h5
1 files changed, 0 insertions, 5 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 4975b97fe..f743bdfc6 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -568,12 +568,7 @@ enum {
568 * and if kernel doesn't support it, fall back to IPv4. 568 * and if kernel doesn't support it, fall back to IPv4.
569 * This is useful if you plan to bind to resulting local lsa. 569 * This is useful if you plan to bind to resulting local lsa.
570 */ 570 */
571#if ENABLE_FEATURE_IPV6
572int xsocket_type(len_and_sockaddr **lsap, int af, int sock_type) FAST_FUNC; 571int xsocket_type(len_and_sockaddr **lsap, int af, int sock_type) FAST_FUNC;
573#else
574int xsocket_type(len_and_sockaddr **lsap, int sock_type) FAST_FUNC;
575#define xsocket_type(lsap, af, sock_type) xsocket_type((lsap), (sock_type))
576#endif
577int xsocket_stream(len_and_sockaddr **lsap) FAST_FUNC; 572int xsocket_stream(len_and_sockaddr **lsap) FAST_FUNC;
578/* Create server socket bound to bindaddr:port. bindaddr can be NULL, 573/* Create server socket bound to bindaddr:port. bindaddr can be NULL,
579 * numeric IP ("N.N.N.N") or numeric IPv6 address, 574 * numeric IP ("N.N.N.N") or numeric IPv6 address,