mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 02:10:09 +01:00
shared: add nm_ip_addr_is_null() helper
This commit is contained in:
parent
ccf59be7f5
commit
0ccb25c5fa
1 changed files with 10 additions and 0 deletions
|
|
@ -126,6 +126,16 @@ typedef struct {
|
|||
|
||||
extern const NMIPAddr nm_ip_addr_zero;
|
||||
|
||||
static inline gboolean
|
||||
nm_ip_addr_is_null (int addr_family, gconstpointer addr)
|
||||
{
|
||||
nm_assert (addr);
|
||||
if (addr_family == AF_INET6)
|
||||
return IN6_IS_ADDR_UNSPECIFIED ((const struct in6_addr *) addr);
|
||||
nm_assert (addr_family == AF_INET);
|
||||
return ((const struct in_addr *) addr)->s_addr == 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
nm_ip_addr_set (int addr_family, gpointer dst, gconstpointer src)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue