Subject: fixing "telnet 0 doesn't work" bug [kern/6425]
To: None <tech-net@netbsd.org>
From: Luke Mewburn <lukem@cs.rmit.edu.au>
List: tech-net
Date: 11/16/1998 10:49:55
i think i've fixed the problem which Hubert Feyrer reported
in [kern/6425].

in in_pcbconnect() (/sys/netinet/in_pcb.c), there's code to
set the outgoing address if INADDR_ANY is given:
	if (in_nullhost(sin->sin_addr))
		sin->sin_addr = in_ifaddr.tqh_first->ia_broadaddr.sin_addr;
(this code was part of tls' ifaddr hash stuff.)

i believe that this should be:
	if (in_nullhost(sin->sin_addr))
		sin->sin_addr = in_ifaddr.tqh_first->ia_addr.sin_addr;
(ia_addr not ia_broadaddr)

i've tested this change and it works for me.

however, i'm not 100% au fait with this code, and i'm not sure if this
is the correct fix. comments?