summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2004-06-16 10:02:36 +0000
committermaxim <maxim@FreeBSD.org>2004-06-16 10:02:36 +0000
commit32bf9d060d0e1f36f42f99717c0857e4f9ab12c4 (patch)
treeeee85193ced2b101df604b96bdb8c163b9df3394 /sys/netinet/in_pcb.c
parentdfd1f7fd50fffaf75541921fcf86454cd8eb3614 (diff)
downloadFreeBSD-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.c4
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
OpenPOWER on IntegriCloud