From 9106107a509cfb23806e46765ea2704cdd130654 Mon Sep 17 00:00:00 2001 From: Jonh Wendell Date: Thu, 9 Feb 2012 15:14:33 +0100 Subject: 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 Signed-off-by: Denys Vlasenko --- include/libbb.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include') 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 { * and if kernel doesn't support it, fall back to IPv4. * This is useful if you plan to bind to resulting local lsa. */ -#if ENABLE_FEATURE_IPV6 int xsocket_type(len_and_sockaddr **lsap, int af, int sock_type) FAST_FUNC; -#else -int xsocket_type(len_and_sockaddr **lsap, int sock_type) FAST_FUNC; -#define xsocket_type(lsap, af, sock_type) xsocket_type((lsap), (sock_type)) -#endif int xsocket_stream(len_and_sockaddr **lsap) FAST_FUNC; /* Create server socket bound to bindaddr:port. bindaddr can be NULL, * numeric IP ("N.N.N.N") or numeric IPv6 address, -- cgit v1.2.3