mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-22 21:40:27 +01:00
glib-aux: add nm_utils_ip4_address_is_loopback()
This commit is contained in:
parent
51625013d4
commit
76d63c66d7
1 changed files with 10 additions and 2 deletions
|
|
@ -508,8 +508,16 @@ gboolean nm_utils_ip_is_site_local(int addr_family, const void *address);
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define NM_IPV4LL_NETWORK ((in_addr_t) (htonl(0xA9FE0000lu)))
|
||||
#define NM_IPV4LL_NETMASK ((in_addr_t) (htonl(0xFFFF0000lu)))
|
||||
#define NM_IPV4LL_NETWORK ((in_addr_t) htonl(0xA9FE0000lu))
|
||||
#define NM_IPV4LL_NETMASK ((in_addr_t) htonl(0xFFFF0000lu))
|
||||
|
||||
static inline gboolean
|
||||
nm_utils_ip4_address_is_loopback(in_addr_t addr)
|
||||
{
|
||||
/* There is also IN_LOOPBACK() in <linux/in.h>, but there the
|
||||
* argument is in host order not `in_addr_t`. */
|
||||
return (addr & htonl(0xFF000000u)) == htonl(0x7F000000u);
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
nm_utils_ip4_address_is_link_local(in_addr_t addr)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue