summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ipaddrcheck_functions.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ipaddrcheck_functions.c b/src/ipaddrcheck_functions.c
index 061ba8f..2ba8de2 100644
--- a/src/ipaddrcheck_functions.c
+++ b/src/ipaddrcheck_functions.c
@@ -244,7 +244,11 @@ int is_ipv4_broadcast(CIDR *address)
{
int result;
- if( cidr_equals(address, cidr_addr_broadcast(address)) == 0 )
+ /* The very concept of broadcast address doesn't apply to
+ IPv6 and point-to-point or /32 IPv4 */
+ if( (cidr_get_proto(address) == CIDR_IPV4) &&
+ (cidr_equals(address, cidr_addr_broadcast(address)) == 0 ) &&
+ (cidr_get_pflen(address) < 31) )
{
result = RESULT_SUCCESS;
}