From a7aeca6ef84a292d194872ebab09fb9f36ae82b2 Mon Sep 17 00:00:00 2001 From: ericj <> Date: Tue, 26 Jun 2001 21:19:14 +0000 Subject: dont set the source address to 127.0.0.1 if a local port is specified but no source address reported by jakob@ --- src/usr.bin/nc/netcat.c | 5 +++-- 1 file 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 @@ -/* $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 * @@ -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; -- cgit v1.2.3-55-g6feb