summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-10-08 07:33:43 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-10-08 07:33:43 +0000
commitaac63e0873787a47e687b0236571c3ee03354f6d (patch)
tree0aa3d7a0739053e4c8c3eaad56a6e3ee2a62c9ed /sys/netinet/ip_output.c
parenteebbc0d31a819cbb77bdeaea780aa18ea9bad45c (diff)
Check if the outgoing route is associated to a broadcast address instead
of doing a lookup on all the addresses of the outgoing interface. ok henning@
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 2244cef7de8..68032bc96d0 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.267 2014/09/27 12:26:16 mpi Exp $ */
+/* $OpenBSD: ip_output.c,v 1.268 2014/10/08 07:33:42 mpi Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -484,8 +484,8 @@ reroute:
* such a packet; if the packet is going in an IPsec tunnel, skip
* this check.
*/
- if ((sproto == 0) && (in_broadcast(dst->sin_addr, ifp,
- m->m_pkthdr.ph_rtableid))) {
+ if ((sproto == 0) && ((dst->sin_addr.s_addr == INADDR_BROADCAST) ||
+ (ro && ro->ro_rt && ISSET(ro->ro_rt->rt_flags, RTF_BROADCAST)))) {
if ((ifp->if_flags & IFF_BROADCAST) == 0) {
error = EADDRNOTAVAIL;
goto bad;