aboutsummaryrefslogtreecommitdiff
path: root/libbb/xconnect.c
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-01-13 21:05:38 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-01-13 21:05:38 +0000
commit2418288cac34272d99dc8b9f46a74163eff5ea2c (patch)
tree5d7ec0b0b1ff0fbcd64d0734a4d93f13f99ef1f1 /libbb/xconnect.c
parent3a34d0c08a77ee48edc3f4353cc49b95aba85c2f (diff)
downloadbusybox-2418288cac34272d99dc8b9f46a74163eff5ea2c.tar.gz
busybox-2418288cac34272d99dc8b9f46a74163eff5ea2c.tar.bz2
small fixes to ipv6 infrastructure
Diffstat (limited to 'libbb/xconnect.c')
-rw-r--r--libbb/xconnect.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libbb/xconnect.c b/libbb/xconnect.c
index 65554b24e..377e0657e 100644
--- a/libbb/xconnect.c
+++ b/libbb/xconnect.c
@@ -48,6 +48,7 @@ unsigned bb_lookup_port(const char *port, const char *protocol, unsigned default
port_nr = bb_strtou(port, NULL, 10);
if (errno || port_nr > 65535) {
struct servent *tserv = getservbyname(port, protocol);
+ port_nr = default_port;
if (tserv)
port_nr = ntohs(tserv->s_port);
}
@@ -213,6 +214,7 @@ int create_and_bind_stream_or_die(const char *bindaddr, int port)
fd = xsocket(lsa->sa.sa_family, SOCK_STREAM, 0);
} else {
fd = xsocket_stream(&lsa);
+ set_nport(lsa, htons(port));
}
setsockopt_reuseaddr(fd);
xbind(fd, &lsa->sa, lsa->len);