diff options
author | Denis Vlasenko | 2007-01-12 10:35:23 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-01-12 10:35:23 +0000 |
commit | 6536a9b5833febe719988526a095a9cacb8a1042 (patch) | |
tree | 07b65c5cf7e1f51909d4e7b516253bae7611fa48 /networking/nc.c | |
parent | f8138d1f91c913166bffb0077a0fe06831a77ecf (diff) | |
download | busybox-6536a9b5833febe719988526a095a9cacb8a1042.zip busybox-6536a9b5833febe719988526a095a9cacb8a1042.tar.gz |
next part of ipv6-ization is here: wget & httpd
Diffstat (limited to 'networking/nc.c')
-rw-r--r-- | networking/nc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/networking/nc.c b/networking/nc.c index 1419609..e1c2283 100644 --- a/networking/nc.c +++ b/networking/nc.c @@ -37,7 +37,10 @@ int nc_main(int argc, char **argv) "" USE_NC_SERVER("lp:") USE_NC_EXTRA("w:i:f:e:") )) > 0 ) { 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)); + 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)); else if (ENABLE_NC_EXTRA && opt=='f') USE_NC_EXTRA( cfd = xopen(optarg, O_RDWR)); @@ -119,6 +122,7 @@ int nc_main(int argc, char **argv) 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; |