diff --git a/include/libbb.h b/include/libbb.h
index 07b1d11..c088946 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -307,6 +307,9 @@
 #endif
 	};
 } len_and_sockaddr;
+/* Create stream socket, and allocated suitable lsa
+ * (lsa of correct size and lsa->sa.sa_family (AF_INET/AF_INET6)) */
+int xsocket_stream(len_and_sockaddr **lsap);
 /* Create server TCP socket bound to bindaddr:port. bindaddr can be NULL,
  * numeric IP ("N.N.N.N") or numeric IPv6 address,
  * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT").
@@ -324,12 +327,14 @@
  * (depending on host), but in theory nothing prevents e.g.
  * UNIX socket address being returned, IPX sockaddr etc... */
 extern len_and_sockaddr* host2sockaddr(const char *host, int port);
-/* assign sin[6]_port member if the socket is of corresponding type,
+/* Assign sin[6]_port member if the socket is of corresponding type,
  * otherwise noop. Useful for ftp.
  * NB: does NOT do htons() internally, just direct assignment. */
-extern void set_port(len_and_sockaddr *lsa, unsigned port);
-char* xmalloc_sockaddr2host(const struct sockaddr *sa, socklen_t salen);
-char* xmalloc_sockaddr2dotted(const struct sockaddr *sa, socklen_t salen);
+extern void set_nport(len_and_sockaddr *lsa, unsigned port);
+/* Retrieve sin[6]_port or return -1 for non-inet lsa's */
+extern int get_nport(len_and_sockaddr *lsa);
+extern char* xmalloc_sockaddr2host(const struct sockaddr *sa, socklen_t salen);
+extern char* xmalloc_sockaddr2dotted(const struct sockaddr *sa, socklen_t salen);
 
 
 extern char *xstrdup(const char *s);
diff --git a/include/usage.h b/include/usage.h
index 4e52065..0275df3 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -2249,7 +2249,7 @@
        "\n	-e	Exec rest of command line after connect" \
        "\n	-i SECS	Delay interval for lines sent" \
        "\n	-w SECS	Timeout for connect" \
-       "\n	-f file	Use file (ala /dev/ttyS0) instead of network" \
+       "\n	-f FILE	Use file (ala /dev/ttyS0) instead of network" \
 	) \
 	USE_NC_SERVER( \
        "\n	-l	Listen mode, for inbound connects" \
diff --git a/libbb/xconnect.c b/libbb/xconnect.c
index f5a7e6d..65554b2 100644
--- a/libbb/xconnect.c
+++ b/libbb/xconnect.c
@@ -32,7 +32,7 @@
 	}
 }
 
-/* Return network byte ordered port number for a service.
+/* Return port number for a service.
  * If "port" is a number use it as the port.
  * If "port" is a name it is looked up in /etc/services, if it isnt found return
  * default_port */
@@ -81,7 +81,21 @@
 /* "New" networking API */
 
 
-void set_port(len_and_sockaddr *lsa, unsigned port)
+int get_nport(len_and_sockaddr *lsa)
+{
+#if ENABLE_FEATURE_IPV6
+	if (lsa->sa.sa_family == AF_INET6) {
+		return lsa->sin6.sin6_port;
+	}
+#endif
+	if (lsa->sa.sa_family == AF_INET) {
+		return lsa->sin.sin_port;
+	}
+	return -1;
+	/* What? UNIX socket? IPX?? :) */
+}
+
+void set_nport(len_and_sockaddr *lsa, unsigned port)
 {
 #if ENABLE_FEATURE_IPV6
 	if (lsa->sa.sa_family == AF_INET6) {
@@ -146,7 +160,7 @@
 	r = xmalloc(offsetof(len_and_sockaddr, sa) + result->ai_addrlen);
 	r->len = result->ai_addrlen;
 	memcpy(&r->sa, result->ai_addr, result->ai_addrlen);
-	set_port(r, htons(port));
+	set_nport(r, htons(port));
 	freeaddrinfo(result);
 	return r;
 }
@@ -161,19 +175,27 @@
 	return str2sockaddr(host, port, NI_NUMERICHOST);
 }
 
-static int xsocket_stream(len_and_sockaddr *lsa)
+int xsocket_stream(len_and_sockaddr **lsap)
 {
+	len_and_sockaddr *lsa;
 	int fd;
+	int len = sizeof(struct sockaddr_in);
+	int family = AF_INET;
+
 #if ENABLE_FEATURE_IPV6
 	fd = socket(AF_INET6, SOCK_STREAM, 0);
-	lsa->sa.sa_family = AF_INET6;
-	lsa->len = sizeof(struct sockaddr_in6);
-	if (fd >= 0)
-		return fd;
+	if (fd >= 0) {
+		len = sizeof(struct sockaddr_in6);
+		family = AF_INET6;
+	} else
 #endif
-	fd = xsocket(AF_INET, SOCK_STREAM, 0);
-	lsa->sa.sa_family = AF_INET;
-	lsa->len = sizeof(struct sockaddr_in);
+	{
+		fd = xsocket(AF_INET, SOCK_STREAM, 0);
+	}
+	lsa = xzalloc(offsetof(len_and_sockaddr, sa) + len);
+	lsa->len = len;
+	lsa->sa.sa_family = family;
+	*lsap = lsa;
 	return fd;
 }
 
@@ -190,11 +212,7 @@
 		/* user specified bind addr dictates family */
 		fd = xsocket(lsa->sa.sa_family, SOCK_STREAM, 0);
 	} else {
-		lsa = xzalloc(offsetof(len_and_sockaddr, sa) +
-			USE_FEATURE_IPV6(sizeof(struct sockaddr_in6))
-			SKIP_FEATURE_IPV6(sizeof(struct sockaddr_in))
-		);
-		fd = xsocket_stream(lsa);
+		fd = xsocket_stream(&lsa);
 	}
 	setsockopt_reuseaddr(fd);
 	xbind(fd, &lsa->sa, lsa->len);
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index 51e2302..0e2d417 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -88,7 +88,7 @@
 	*buf_ptr = '\0';
 	port_num += xatoul_range(buf_ptr + 1, 0, 255) * 256;
 
-	set_port(server->lsa, htons(port_num));
+	set_nport(server->lsa, htons(port_num));
 	return xconnect_stream(server->lsa);
 }
 
diff --git a/networking/nc.c b/networking/nc.c
index e1c2283..37e658d 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -9,6 +9,10 @@
 
 #include "busybox.h"
 
+/* Lots of small differences in features
+ * when compared to "standard" nc
+ */
+
 static void timeout(int signum)
 {
 	bb_error_msg_and_die("timed out");
@@ -16,7 +20,8 @@
 
 int nc_main(int argc, char **argv)
 {
-	int sfd = 0;
+	/* sfd sits _here_ only because of "repeat" option (-l -l). */
+	int sfd = sfd; /* for gcc */
 	int cfd = 0;
 	SKIP_NC_SERVER(const) unsigned do_listen = 0;
 	SKIP_NC_SERVER(const) unsigned lport = 0;
@@ -24,12 +29,10 @@
 	SKIP_NC_EXTRA (const) unsigned delay = 0;
 	SKIP_NC_EXTRA (const int execparam = 0;)
 	USE_NC_EXTRA  (char **execparam = NULL;)
-	struct sockaddr_in address;
+	len_and_sockaddr *lsa;
 	fd_set readfds, testfds;
 	int opt; /* must be signed (getopt returns -1) */
 
-	memset(&address, 0, sizeof(address));
-
 	if (ENABLE_NC_SERVER || ENABLE_NC_EXTRA) {
 		/* getopt32 is _almost_ usable:
 		** it cannot handle "... -e prog -prog-opt" */
@@ -39,7 +42,6 @@
 			if (ENABLE_NC_SERVER && opt=='l')      USE_NC_SERVER(do_listen++);
 			else if (ENABLE_NC_SERVER && opt=='p') {
 				USE_NC_SERVER(lport = bb_lookup_port(optarg, "tcp", 0));
-				USE_NC_SERVER(lport = htons(lport));
 			}
 			else if (ENABLE_NC_EXTRA  && opt=='w') USE_NC_EXTRA( wsecs = xatou(optarg));
 			else if (ENABLE_NC_EXTRA  && opt=='i') USE_NC_EXTRA( delay = xatou(optarg));
@@ -71,9 +73,11 @@
 		// -l and -f don't mix
 		if (do_listen && cfd) bb_show_usage();
 		// Listen or file modes need zero arguments, client mode needs 2
-		opt = ((do_listen || cfd) ? 0 : 2);
-		if (argc != opt)
-			bb_show_usage();
+		if (do_listen || cfd) {
+			if (argc) bb_show_usage();
+		} else {
+			if (!argc || argc > 2) bb_show_usage();
+		}
 	} else {
 		if (argc != 3) bb_show_usage();
 		argc--;
@@ -86,46 +90,37 @@
 	}
 
 	if (!cfd) {
-		sfd = xsocket(AF_INET, SOCK_STREAM, 0);
-		fcntl(sfd, F_SETFD, FD_CLOEXEC);
-		setsockopt_reuseaddr(sfd);
-		address.sin_family = AF_INET;
-
-		// Set local port.
-
-		if (lport != 0) {
-			address.sin_port = lport;
-			xbind(sfd, (struct sockaddr *) &address, sizeof(address));
-		}
-
 		if (do_listen) {
-			socklen_t addrlen = sizeof(address);
+			socklen_t addrlen;
 
-			xlisten(sfd, do_listen);
-
-			// If we didn't specify a port number, query and print it to stderr.
-
+			/* create_and_bind_stream_or_die(NULL, lport)
+			 * would've work wonderfully, but we need
+			 * to know lsa */
+			sfd = xsocket_stream(&lsa);
+			if (lport)
+				set_nport(lsa, htons(lport));
+			setsockopt_reuseaddr(sfd);
+			xbind(sfd, &lsa->sa, lsa->len);
+			xlisten(sfd, do_listen); /* can be > 1 */
+			/* If we didn't specify a port number,
+			 * query and print it after listen() */
 			if (!lport) {
-				socklen_t len = sizeof(address);
-				getsockname(sfd, (struct sockaddr *) &address, &len);
-				fdprintf(2, "%d\n", SWAP_BE16(address.sin_port));
+				addrlen = lsa->len;
+				getsockname(sfd, &lsa->sa, &addrlen);
+				lport = get_nport(lsa);
+				fdprintf(2, "%d\n", ntohs(lport));
 			}
- repeatyness:
-			cfd = accept(sfd, (struct sockaddr *) &address, &addrlen);
+			fcntl(sfd, F_SETFD, FD_CLOEXEC);
+ accept_again:
+			addrlen = lsa->len;
+			cfd = accept(sfd, NULL, 0); /* &lsa->sa, &addrlen); */
 			if (cfd < 0)
 				bb_perror_msg_and_die("accept");
-
-			if (!execparam) close(sfd);
+			if (!execparam)
+				close(sfd);
 		} else {
-			struct hostent *hostinfo;
-			hostinfo = xgethostbyname(argv[0]);
-
-			address.sin_addr = *(struct in_addr *) *hostinfo->h_addr_list;
-			address.sin_port = bb_lookup_port(argv[1], "tcp", 0);
-			address.sin_port = htons(address.sin_port);
-
-			xconnect(sfd, (struct sockaddr *) &address, sizeof(address));
-			cfd = sfd;
+			cfd = create_and_connect_stream_or_die(argv[0],
+				argv[1] ? bb_lookup_port(argv[1], "tcp", 0) : 0);
 		}
 	}
 
@@ -136,17 +131,10 @@
 
 	/* -e given? */
 	if (execparam) {
-		if (cfd) {
-			signal(SIGCHLD, SIG_IGN);
-			dup2(cfd, 0);
-			close(cfd);
-		}
-		dup2(0, 1);
-		dup2(0, 2);
-
+		signal(SIGCHLD, SIG_IGN);
 		// With more than one -l, repeatedly act as server.
-
 		if (do_listen > 1 && vfork()) {
+			/* parent */
 			// This is a bit weird as cleanup goes, since we wind up with no
 			// stdin/stdout/stderr.  But it's small and shouldn't hurt anything.
 			// We check for cfd == 0 above.
@@ -154,9 +142,15 @@
 			close(0);
 			close(1);
 			close(2);
-
-			goto repeatyness;
+			goto accept_again;
 		}
+		/* child (or main thread if no multiple -l) */
+		if (cfd) {
+			dup2(cfd, 0);
+			close(cfd);
+		}
+		dup2(0, 1);
+		dup2(0, 2);
 		USE_NC_EXTRA(execvp(execparam[0], execparam);)
 		/* Don't print stuff or it will go over the wire.... */
 		_exit(127);
@@ -184,7 +178,8 @@
 							sizeof(bb_common_bufsiz1));
 
 				if (fd == cfd) {
-					if (nread<1) exit(0);
+					if (nread < 1)
+						exit(0);
 					ofd = STDOUT_FILENO;
 				} else {
 					if (nread<1) {
diff --git a/networking/wget.c b/networking/wget.c
index 22e6106..cc768db 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -432,7 +432,7 @@
 		s = strrchr(buf, ',');
 		if (!s) goto pasv_error;
 		port += xatou_range(s+1, 0, 255) * 256;
-		set_port(lsa, htons(port));
+		set_nport(lsa, htons(port));
 		dfp = open_socket(lsa);
 
 		if (beg_range) {
