core: add nm_utils_ip4_address_is_zeronet() helper

This commit is contained in:
Thomas Haller 2020-07-28 09:16:28 +02:00
parent 63b788dad2
commit 7670899d2c
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -479,6 +479,13 @@ nm_utils_ip4_address_is_link_local (in_addr_t addr)
return (addr & NM_IPV4LL_NETMASK) == NM_IPV4LL_NETWORK;
}
static inline gboolean
nm_utils_ip4_address_is_zeronet (in_addr_t network)
{
/* Same as ipv4_is_zeronet() from kernel's include/linux/in.h. */
return (network & htonl (0xFF000000u)) == htonl (0x00000000u);
}
/*****************************************************************************/
const char *nm_utils_dnsmasq_status_to_string (int status, char *dest, gsize size);