diff options
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; |