diff options
author | maxim <maxim@FreeBSD.org> | 2004-06-16 10:02:36 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2004-06-16 10:02:36 +0000 |
commit | 32bf9d060d0e1f36f42f99717c0857e4f9ab12c4 (patch) | |
tree | eee85193ced2b101df604b96bdb8c163b9df3394 /sys/netinet/in_pcb.c | |
parent | dfd1f7fd50fffaf75541921fcf86454cd8eb3614 (diff) | |
download | FreeBSD-src-32bf9d060d0e1f36f42f99717c0857e4f9ab12c4.zip FreeBSD-src-32bf9d060d0e1f36f42f99717c0857e4f9ab12c4.tar.gz |
o connect(2): if there is no a route to the destination
do not pick up the first local ip address for the source
ip address, return ENETUNREACH instead.
Submitted by: Gleb Smirnoff
Reviewed by: -current (silence)
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r-- | sys/netinet/in_pcb.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index adad6de..26076b9 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -614,9 +614,7 @@ in_pcbconnect_setup(inp, nam, laddrp, lportp, faddrp, fportp, oinpp, cred) if (ia == 0) ia = ifatoia(ifa_ifwithnet(sintosa(&sa))); if (ia == 0) - ia = TAILQ_FIRST(&in_ifaddrhead); - if (ia == 0) - return (EADDRNOTAVAIL); + return (ENETUNREACH); } /* * If the destination address is multicast and an outgoing |