diff options
author | Daniil Baturin <daniil@baturin.org> | 2013-06-02 11:44:00 -0700 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2013-06-02 11:44:00 -0700 |
commit | bb6f0c4e01655e7f9732cf04641c92c1b53304a3 (patch) | |
tree | b5ee1f326ae86fc55cdfa6281463f7b8ce886ef7 | |
parent | e7f0f079d3086e53ca13e372b9123968a90ef39e (diff) | |
download | ipaddrcheck-bb6f0c4e01655e7f9732cf04641c92c1b53304a3.tar.gz ipaddrcheck-bb6f0c4e01655e7f9732cf04641c92c1b53304a3.zip |
Don't allow IPv4 limited broadcast address as valid interface address.
-rw-r--r-- | src/ipaddrcheck_functions.c | 1 | ||||
-rw-r--r-- | src/ipaddrcheck_functions.h | 1 |
2 files changed, 2 insertions, 0 deletions
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" |