diff options
author | Eric Jackson <ericj@cvs.openbsd.org> | 2001-06-26 21:19:15 +0000 |
---|---|---|
committer | Eric Jackson <ericj@cvs.openbsd.org> | 2001-06-26 21:19:15 +0000 |
commit | 062626c9eb8ba754e1a1f5b84ba11d37141de429 (patch) | |
tree | 24f1c384c999b4e19b8ba3b0253905d3f45ee7b6 /usr.bin | |
parent | e81e068b9d39b774f24d2c4870042c17a6f38dd4 (diff) |
dont set the source address to 127.0.0.1 if a local port is specified
but no source address
reported by jakob@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/nc/netcat.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c index dd1e5894207..2d179f559d4 100644 --- a/usr.bin/nc/netcat.c +++ b/usr.bin/nc/netcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.24 2001/06/26 20:53:14 ericj Exp $ */ +/* $OpenBSD: netcat.c,v 1.25 2001/06/26 21:19:14 ericj Exp $ */ /* * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> * @@ -296,6 +296,7 @@ remote_connect(host, port, hints) ahints.ai_family = res0->ai_family; ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; ahints.ai_protocol = uflag ? IPPROTO_UDP : IPPROTO_TCP; + ahints.ai_flags = AI_PASSIVE; if (getaddrinfo(sflag, pflag, &ahints, &ares)) errx(1, "%s", gai_strerror(error)); @@ -447,7 +448,7 @@ atelnet(nfd, buf, size) if (*p != IAC) break; - obuf[0]=IAC; + obuf[0] = IAC; p++; if ((*p == WILL) || (*p == WONT)) { obuf[1] = DONT; |