summaryrefslogtreecommitdiffstats
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authorchrisz <chrisz@openbsd.org>2014-04-07 19:51:15 +0000
committerchrisz <chrisz@openbsd.org>2014-04-07 19:51:15 +0000
commitaa3690bd9327e17370c84e528201e38bb8b5e50a (patch)
tree56e0645be71db67a8d004f9482dfaf00c0688328 /sys/netinet/udp_usrreq.c
parentAdd some missing names to the NAME sections. (diff)
downloadwireguard-openbsd-aa3690bd9327e17370c84e528201e38bb8b5e50a.tar.xz
wireguard-openbsd-aa3690bd9327e17370c84e528201e38bb8b5e50a.zip
In udp_output() also use the correct source address in case of an unbound socket.
OK claudio@
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 070f9486380..09f1b3689f0 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_usrreq.c,v 1.178 2014/04/07 10:04:17 mpi Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.179 2014/04/07 19:51:15 chrisz Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@@ -1019,6 +1019,8 @@ udp_output(struct mbuf *m, ...)
error = ENOTCONN;
goto release;
}
+ if (laddr.s_addr == INADDR_ANY)
+ laddr = inp->inp_laddr;
}
#ifdef IPSEC