diff options
author | ericj <> | 2001-06-26 21:19:14 +0000 |
---|---|---|
committer | ericj <> | 2001-06-26 21:19:14 +0000 |
commit | a7aeca6ef84a292d194872ebab09fb9f36ae82b2 (patch) | |
tree | b735025dc7b78303bace413b0aabb0dbe29d6c30 | |
parent | 1c723c1432496046a48f42b968895c86d6edf3ee (diff) | |
download | openbsd-a7aeca6ef84a292d194872ebab09fb9f36ae82b2.tar.gz openbsd-a7aeca6ef84a292d194872ebab09fb9f36ae82b2.tar.bz2 openbsd-a7aeca6ef84a292d194872ebab09fb9f36ae82b2.zip |
dont set the source address to 127.0.0.1 if a local port is specified
but no source address
reported by jakob@
-rw-r--r-- | src/usr.bin/nc/netcat.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c index dd1e589420..2d179f559d 100644 --- a/src/usr.bin/nc/netcat.c +++ b/src/usr.bin/nc/netcat.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: netcat.c,v 1.24 2001/06/26 20:53:14 ericj Exp $ */ | 1 | /* $OpenBSD: netcat.c,v 1.25 2001/06/26 21:19:14 ericj Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> | 3 | * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> |
4 | * | 4 | * |
@@ -296,6 +296,7 @@ remote_connect(host, port, hints) | |||
296 | ahints.ai_family = res0->ai_family; | 296 | ahints.ai_family = res0->ai_family; |
297 | ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; | 297 | ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; |
298 | ahints.ai_protocol = uflag ? IPPROTO_UDP : IPPROTO_TCP; | 298 | ahints.ai_protocol = uflag ? IPPROTO_UDP : IPPROTO_TCP; |
299 | ahints.ai_flags = AI_PASSIVE; | ||
299 | if (getaddrinfo(sflag, pflag, &ahints, &ares)) | 300 | if (getaddrinfo(sflag, pflag, &ahints, &ares)) |
300 | errx(1, "%s", gai_strerror(error)); | 301 | errx(1, "%s", gai_strerror(error)); |
301 | 302 | ||
@@ -447,7 +448,7 @@ atelnet(nfd, buf, size) | |||
447 | if (*p != IAC) | 448 | if (*p != IAC) |
448 | break; | 449 | break; |
449 | 450 | ||
450 | obuf[0]=IAC; | 451 | obuf[0] = IAC; |
451 | p++; | 452 | p++; |
452 | if ((*p == WILL) || (*p == WONT)) { | 453 | if ((*p == WILL) || (*p == WONT)) { |
453 | obuf[1] = DONT; | 454 | obuf[1] = DONT; |