core: move nm_utils_ip4_address_is_link_local() to header file

It's so simple, let's move it so it can be inlined.
This commit is contained in:
Thomas Haller 2020-07-22 18:28:12 +02:00
parent b2df6fde30
commit b15c85cf8b
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 12 additions and 12 deletions

View file

@ -3829,17 +3829,6 @@ nm_utils_ifname_cpy (char *dst, const char *name)
/*****************************************************************************/
#define IPV4LL_NETWORK (htonl (0xA9FE0000L))
#define IPV4LL_NETMASK (htonl (0xFFFF0000L))
gboolean
nm_utils_ip4_address_is_link_local (in_addr_t addr)
{
return (addr & IPV4LL_NETMASK) == IPV4LL_NETWORK;
}
/*****************************************************************************/
/**
* Takes a pair @timestamp and @duration, and returns the remaining duration based
* on the new timestamp @now.

View file

@ -446,7 +446,18 @@ guint32 nm_utils_lifetime_get (guint32 timestamp,
gint32 now,
guint32 *out_preferred);
gboolean nm_utils_ip4_address_is_link_local (in_addr_t addr);
/*****************************************************************************/
#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_link_local (in_addr_t addr)
{
return (addr & NM_IPV4LL_NETMASK) == NM_IPV4LL_NETWORK;
}
/*****************************************************************************/
const char *nm_utils_dnsmasq_status_to_string (int status, char *dest, gsize size);