summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormickey <mickey@openbsd.org>2000-09-22 01:40:56 +0000
committermickey <mickey@openbsd.org>2000-09-22 01:40:56 +0000
commit8cc16f4e1ca354879a2badeb0341f79a61095a23 (patch)
tree7539807b26208b0ab6c1577a9e1401b53b38dbec
parentChange ipflog entry; joe@nall.com (diff)
downloadwireguard-openbsd-8cc16f4e1ca354879a2badeb0341f79a61095a23.tar.xz
wireguard-openbsd-8cc16f4e1ca354879a2badeb0341f79a61095a23.zip
fix my bug dating back to february the 14th of 1998,
when those wildcard interfaces came up, which were usefull at the times. on the other hand here it is, one cannot bind to the broadcast address, and angelos says ok.
-rw-r--r--sys/netinet/ip_input.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 41495f6693a..ce8eb34146a 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.58 2000/09/19 03:20:58 angelos Exp $ */
+/* $OpenBSD: ip_input.c,v 1.59 2000/09/22 01:40:56 mickey Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -745,7 +745,7 @@ in_iawithaddr(ina, m)
(IFF_LOOPBACK|IFF_LINK1) &&
ia->ia_subnet == (ina.s_addr & ia->ia_subnetmask)))
return ia;
- if (m && ((ip_directedbcast == 0) || (ip_directedbcast &&
+ if (((ip_directedbcast == 0) || (m && ip_directedbcast &&
ia->ia_ifp == m->m_pkthdr.rcvif)) &&
(ia->ia_ifp->if_flags & IFF_BROADCAST)) {
if (ina.s_addr == ia->ia_broadaddr.sin_addr.s_addr ||
@@ -757,7 +757,8 @@ in_iawithaddr(ina, m)
ina.s_addr == ia->ia_subnet ||
ina.s_addr == ia->ia_net) {
/* Make sure M_BCAST is set */
- m->m_flags |= M_BCAST;
+ if (m)
+ m->m_flags |= M_BCAST;
return ia;
}
}