From bb6f0c4e01655e7f9732cf04641c92c1b53304a3 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 2 Jun 2013 11:44:00 -0700 Subject: Don't allow IPv4 limited broadcast address as valid interface address. --- src/ipaddrcheck_functions.c | 1 + src/ipaddrcheck_functions.h | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/ipaddrcheck_functions.c b/src/ipaddrcheck_functions.c index 0240914..92c2aca 100644 --- a/src/ipaddrcheck_functions.c +++ b/src/ipaddrcheck_functions.c @@ -455,6 +455,7 @@ int is_valid_intf_address(CIDR *address, char* address_str, int allow_loopback) (cidr_equals(address, cidr_from_str(IPV6_LOOPBACK)) != 0) && (cidr_equals(address, cidr_from_str(IPV4_UNSPECIFIED)) != 0) && (cidr_contains(cidr_from_str(IPV4_THIS), address) != 0) && + (cidr_equals(address, cidr_from_str(IPV4_LIMITED_BROADCAST)) != 0) && (is_any_cidr(address_str) == RESULT_SUCCESS) ) { result = RESULT_SUCCESS; diff --git a/src/ipaddrcheck_functions.h b/src/ipaddrcheck_functions.h index bf39338..78378f7 100644 --- a/src/ipaddrcheck_functions.h +++ b/src/ipaddrcheck_functions.h @@ -43,6 +43,7 @@ #define IPV4_RFC1918_A "10.0.0.0/8" #define IPV4_RFC1918_B "172.16.0.0/12" #define IPV4_RFC1918_C "192.168.0.0/16" +#define IPV4_LIMITED_BROADCAST "255.255.255.255/32" #define IPV6_MULTICAST "ff00::/8" #define IPV6_LINKLOCAL "fe80::/64" #define IPV6_LOOPBACK "::1/128" -- cgit v1.2.3