diff options
author | Thomas Haller <thaller@redhat.com> | 2020-07-22 18:28:12 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-07-24 16:03:15 +0200 |
commit | b15c85cf8b0135b76b60bbae4863cac6a2efcb22 (patch) | |
tree | c62182f0df6c6ff292d922e316649a156164ef86 | |
parent | b2df6fde303eab163e4dff9a260e9bf7a35588ed (diff) | |
download | NetworkManager-b15c85cf8b0135b76b60bbae4863cac6a2efcb22.tar.gz |
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.
-rw-r--r-- | src/nm-core-utils.c | 11 | ||||
-rw-r--r-- | src/nm-core-utils.h | 13 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c index d186405672..75e0941aa9 100644 --- a/src/nm-core-utils.c +++ b/src/nm-core-utils.c @@ -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. diff --git a/src/nm-core-utils.h b/src/nm-core-utils.h index 190a81aa81..5d36bd593c 100644 --- a/src/nm-core-utils.h +++ b/src/nm-core-utils.h @@ -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); |