From 5c51a7ca52beb6958fda45f0de480f6ac1769ec6 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 5 Jun 2007 20:08:11 +0000 Subject: nc: make connecting to IPv4 from IPv6-enabled hosts easier (was requiring -s ) --- include/libbb.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index 013633716..dd0f5c1cc 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -304,9 +304,12 @@ enum { } ) }; -/* Create stream socket, and allocated suitable lsa - * (lsa of correct size and lsa->sa.sa_family (AF_INET/AF_INET6)) */ -int xsocket_type(len_and_sockaddr **lsap, int sock_type); +/* Create stream socket, and allocate suitable lsa. + * (lsa of correct size and lsa->sa.sa_family (AF_INET/AF_INET6)) + * af == AF_UNSPEC will result in trying to create IPv6, and + * if kernel doesn't support it, IPv4. + */ +int xsocket_type(len_and_sockaddr **lsap, USE_FEATURE_IPV6(int af,) int sock_type); int xsocket_stream(len_and_sockaddr **lsap); /* 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