Index: sys/netinet/in.c =================================================================== --- sys/netinet/in.c +++ sys/netinet/in.c @@ -87,6 +87,12 @@ &VNET_NAME(nosameprefix), 0, "Refuse to create same prefixes on different interfaces"); +VNET_DEFINE_STATIC(bool, broadcast_zero); +#define V_broadcast_zero VNET(broadcast_zero) +SYSCTL_BOOL(_net_inet_ip, OID_AUTO, broadcast_zero, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(broadcast_zero), 0, + "Treat host address 0 on a subnet as broadcast"); + VNET_DECLARE(struct inpcbinfo, ripcbinfo); #define V_ripcbinfo VNET(ripcbinfo) @@ -1135,10 +1141,10 @@ return ((in.s_addr == ia->ia_broadaddr.sin_addr.s_addr || /* - * Check for old-style (host 0) broadcast, but + * Optionally check for old-style (host 0) broadcast, but * taking into account that RFC 3021 obsoletes it. */ - (ia->ia_subnetmask != IN_RFC3021_MASK && + (V_broadcast_zero && ia->ia_subnetmask != IN_RFC3021_MASK && ntohl(in.s_addr) == ia->ia_subnet)) && /* * Check for an all one subnetmask. These