summaryrefslogtreecommitdiff
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
authordenis <denis@cvs.openbsd.org>2020-11-07 09:51:41 +0000
committerdenis <denis@cvs.openbsd.org>2020-11-07 09:51:41 +0000
commitf8d1ac4bca340e6afd3ff9ae454d9d2c703857c5 (patch)
tree24aee78e26365e871b7e433e12e0d38096b221ee /sys/netinet/in_pcb.c
parent9c38e7ef4d59da85e7f4c72891712c88050ce9a9 (diff)
Rework source IP address setting.
- Move most of the processing out of rtable.c (reasonnable tb@, ok bluhm@) - Remove memory allocation, store pointer to existing ifaddr - Fix tunnel interface handling looks fine mpi@
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 213eab813f6..12ed205c858 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.c,v 1.251 2020/11/05 10:46:13 denis Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.252 2020/11/07 09:51:40 denis Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
@@ -960,12 +960,11 @@ in_pcbselsrc(struct in_addr **insrc, struct sockaddr_in *sin,
/*
* Use preferred source address if :
* - destination is not onlink
- * - output interface is not PtoP
* - preferred source addresss is set
* - output interface is UP
*/
- if ((ro->ro_rt && !(ro->ro_rt->rt_flags & RTF_LLINFO)) &&
- (ia && !(ia->ia_ifp->if_flags & IFF_POINTOPOINT))) {
+ if (ro->ro_rt && !(ro->ro_rt->rt_flags & RTF_LLINFO) &&
+ !(ro->ro_rt->rt_flags & RTF_HOST)) {
ip4_source = rtable_getsource(rtableid, AF_INET);
if (ip4_source != NULL) {
struct ifaddr *ifa;