Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F28198061
freebsd-new.diff
schoen_loyalty.org (Seth Schoen)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
schoen_loyalty.org
Sep 5 2021, 3:24 AM
2021-09-05 03:24:37 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
freebsd-new.diff
View Options
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index d1dd2b31b6ef..2794fc068f09 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -81,6 +81,12 @@ static void in_purgemaddrs(struct ifnet *);
static bool ia_need_loopback_route(const struct in_ifaddr *);
+static bool subnet_addr_is_broadcast = 1;
+
+SYSCTL_BOOL(_net_inet_ip, OID_AUTO, subnet_addr_is_broadcast, CTLFLAG_RW,
+ &subnet_addr_is_broadcast, true,
+ "Treat IPv4 subnet address as a broadcast address");
+
VNET_DEFINE_STATIC(int, nosameprefix);
#define V_nosameprefix VNET(nosameprefix)
SYSCTL_INT(_net_inet_ip, OID_AUTO, no_same_prefix, CTLFLAG_VNET | CTLFLAG_RW,
@@ -1137,9 +1143,11 @@ in_ifaddr_broadcast(struct in_addr in, struct in_ifaddr *ia)
/*
* Check for old-style (host 0) broadcast, but
* taking into account that RFC 3021 obsoletes it.
+ * Also gated by subnet_addr_is_broadcast sysctl.
*/
(ia->ia_subnetmask != IN_RFC3021_MASK &&
- ntohl(in.s_addr) == ia->ia_subnet)) &&
+ ntohl(in.s_addr) == ia->ia_subnet &&
+ subnet_addr_is_broadcast)) &&
/*
* Check for an all one subnetmask. These
* only exist when an interface gets a secondary
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4046175
Default Alt Text
freebsd-new.diff (1 KB)
Attached To
Mode
D19316: IPV4 Experimental address space usage and cleanup of code not using IN_foo
Attached
Detach File
Event Timeline
Log In to Comment