mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-19 20:38:36 +02:00
core: let NM_IS_IP_CONFIG() check for expected addr-family
Still unused...
This commit is contained in:
parent
f11bb3d93d
commit
1c5e790277
3 changed files with 14 additions and 8 deletions
|
|
@ -232,7 +232,7 @@ _ASSERT_ip_config_data (const NMDnsIPConfigData *ip_data)
|
|||
{
|
||||
nm_assert (ip_data);
|
||||
_ASSERT_config_data (ip_data->data);
|
||||
nm_assert (NM_IS_IP_CONFIG (ip_data->ip_config));
|
||||
nm_assert (NM_IS_IP_CONFIG (ip_data->ip_config, AF_UNSPEC));
|
||||
nm_assert (c_list_contains (&ip_data->data->data_lst_head, &ip_data->data_lst));
|
||||
nm_assert (ip_data->data->ifindex == nm_ip_config_get_ifindex (ip_data->ip_config));
|
||||
}
|
||||
|
|
@ -245,7 +245,7 @@ _ip_config_data_new (NMDnsConfigData *data,
|
|||
NMDnsIPConfigData *ip_data;
|
||||
|
||||
_ASSERT_config_data (data);
|
||||
nm_assert (NM_IS_IP_CONFIG (ip_config));
|
||||
nm_assert (NM_IS_IP_CONFIG (ip_config, AF_UNSPEC));
|
||||
nm_assert (ip_config_type != NM_DNS_IP_CONFIG_TYPE_REMOVED);
|
||||
|
||||
ip_data = g_slice_new0 (NMDnsIPConfigData);
|
||||
|
|
@ -1562,7 +1562,7 @@ nm_dns_manager_set_ip_config (NMDnsManager *self,
|
|||
NMDnsIPConfigData **p_best;
|
||||
|
||||
g_return_val_if_fail (NM_IS_DNS_MANAGER (self), FALSE);
|
||||
g_return_val_if_fail (NM_IS_IP_CONFIG (ip_config), FALSE);
|
||||
g_return_val_if_fail (NM_IS_IP_CONFIG (ip_config, AF_UNSPEC), FALSE);
|
||||
|
||||
ifindex = nm_ip_config_get_ifindex (ip_config);
|
||||
g_return_val_if_fail (ifindex > 0, FALSE);
|
||||
|
|
|
|||
|
|
@ -295,9 +295,15 @@ gboolean _nm_ip_config_check_and_add_domain (GPtrArray *array, const char *domai
|
|||
#include "nm-ip6-config.h"
|
||||
|
||||
static inline gboolean
|
||||
NM_IS_IP_CONFIG (gconstpointer config)
|
||||
NM_IS_IP_CONFIG (gconstpointer config, int addr_family)
|
||||
{
|
||||
return NM_IS_IP4_CONFIG (config) || NM_IS_IP6_CONFIG (config);
|
||||
if (addr_family == AF_UNSPEC)
|
||||
return NM_IS_IP4_CONFIG (config) || NM_IS_IP6_CONFIG (config);
|
||||
if (addr_family == AF_INET)
|
||||
return NM_IS_IP4_CONFIG (config);
|
||||
if (addr_family == AF_INET6)
|
||||
return NM_IS_IP6_CONFIG (config);
|
||||
g_return_val_if_reached (FALSE);
|
||||
}
|
||||
|
||||
#if _NM_CC_SUPPORT_GENERIC
|
||||
|
|
@ -334,7 +340,7 @@ NM_IS_IP_CONFIG (gconstpointer config)
|
|||
NMIP6Config * : (NM_IS_IP6_CONFIG (_config))); \
|
||||
})
|
||||
#else
|
||||
#define _NM_IS_IP_CONFIG(typeexpr, config) NM_IS_IP_CONFIG(config)
|
||||
#define _NM_IS_IP_CONFIG(typeexpr, config) NM_IS_IP_CONFIG(config, AF_UNSPEC)
|
||||
#endif
|
||||
|
||||
#define NM_IP_CONFIG_CAST(config) \
|
||||
|
|
|
|||
|
|
@ -1910,8 +1910,8 @@ device_ip_config_changed (NMDevice *device,
|
|||
int addr_family;
|
||||
|
||||
nm_assert (new_config || old_config);
|
||||
nm_assert (!new_config || NM_IS_IP_CONFIG (new_config));
|
||||
nm_assert (!old_config || NM_IS_IP_CONFIG (old_config));
|
||||
nm_assert (!new_config || NM_IS_IP_CONFIG (new_config, AF_UNSPEC));
|
||||
nm_assert (!old_config || NM_IS_IP_CONFIG (old_config, AF_UNSPEC));
|
||||
|
||||
if (new_config) {
|
||||
addr_family = nm_ip_config_get_addr_family (new_config);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue