Commit 7f43e0a7 authored by Thomas Haller's avatar Thomas Haller

platform/trivial: rename NMPlatformIP6Address's "flags" field to "n_ifa_flags"

There are far too many "flags". Rename the "flags" to "n_ifa_flags"
which reminds to "ifa_flags" in 'struct ifaddrmsg', but with a
distinctive "n_" prefix.
parent e18cdc10
......@@ -1156,7 +1156,7 @@ nmtst_platform_ip6_address_full (const char *address, const char *peer_address,
addr->timestamp = timestamp;
addr->lifetime = lifetime;
addr->preferred = preferred;
addr->flags = flags;
addr->n_ifa_flags = flags;
return addr;
}
......
......@@ -5476,7 +5476,7 @@ check_and_add_ipv6ll_addr (NMDevice *self)
addr = nm_ip6_config_get_address (priv->ip6_config, i);
if ( IN6_IS_ADDR_LINKLOCAL (&addr->address)
&& !(addr->flags & IFA_F_DADFAILED)) {
&& !(addr->n_ifa_flags & IFA_F_DADFAILED)) {
/* Already have an LL address, nothing to do */
return;
}
......@@ -5683,7 +5683,7 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *self)
if (address.preferred > address.lifetime)
address.preferred = address.lifetime;
address.source = NM_IP_CONFIG_SOURCE_RDISC;
address.flags = ifa_flags;
address.n_ifa_flags = ifa_flags;
nm_ip6_config_add_address (priv->ac_ip6_config, &address);
}
......@@ -8957,8 +8957,8 @@ device_ipx_changed (NMPlatform *platform,
if ( priv->state > NM_DEVICE_STATE_DISCONNECTED
&& priv->state < NM_DEVICE_STATE_DEACTIVATING
&& ( (change_type == NM_PLATFORM_SIGNAL_CHANGED && addr->flags & IFA_F_DADFAILED)
|| (change_type == NM_PLATFORM_SIGNAL_REMOVED && addr->flags & IFA_F_TENTATIVE))) {
&& ( (change_type == NM_PLATFORM_SIGNAL_CHANGED && addr->n_ifa_flags & IFA_F_DADFAILED)
|| (change_type == NM_PLATFORM_SIGNAL_REMOVED && addr->n_ifa_flags & IFA_F_TENTATIVE))) {
priv->dad6_failed_addrs = g_slist_append (priv->dad6_failed_addrs,
g_memdup (addr, sizeof (NMPlatformIP6Address)));
}
......
......@@ -191,7 +191,7 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, gpointer user_da
if (address.preferred > address.lifetime)
address.preferred = address.lifetime;
address.source = NM_IP_CONFIG_SOURCE_RDISC;
address.flags = ifa_flags;
address.n_ifa_flags = ifa_flags;
nm_ip6_config_add_address (ip6_config, &address);
}
......@@ -333,8 +333,8 @@ ip6_address_changed (NMPlatform *platform,
NMPlatformSignalChangeType change_type,
NMRDisc *rdisc)
{
if ( (change_type == NM_PLATFORM_SIGNAL_CHANGED && addr->flags & IFA_F_DADFAILED)
|| (change_type == NM_PLATFORM_SIGNAL_REMOVED && addr->flags & IFA_F_TENTATIVE))
if ( (change_type == NM_PLATFORM_SIGNAL_CHANGED && addr->n_ifa_flags & IFA_F_DADFAILED)
|| (change_type == NM_PLATFORM_SIGNAL_REMOVED && addr->n_ifa_flags & IFA_F_TENTATIVE))
nm_rdisc_dad_failed (rdisc, &addr->address);
}
......
......@@ -222,8 +222,8 @@ _addresses_sort_cmp (gconstpointer a, gconstpointer b, gpointer user_data)
/* tentative addresses are always sorted back... */
/* sort tentative addresses after non-tentative. */
tent1 = (a1->flags & IFA_F_TENTATIVE);
tent2 = (a2->flags & IFA_F_TENTATIVE);
tent1 = (a1->n_ifa_flags & IFA_F_TENTATIVE);
tent2 = (a2->n_ifa_flags & IFA_F_TENTATIVE);
if (tent1 != tent2)
return tent1 ? 1 : -1;
......@@ -234,20 +234,20 @@ _addresses_sort_cmp (gconstpointer a, gconstpointer b, gpointer user_data)
if (p1 != p2)
return p1 > p2 ? -1 : 1;
ipv6_privacy1 = !!(a1->flags & (IFA_F_MANAGETEMPADDR | IFA_F_TEMPORARY));
ipv6_privacy2 = !!(a2->flags & (IFA_F_MANAGETEMPADDR | IFA_F_TEMPORARY));
ipv6_privacy1 = !!(a1->n_ifa_flags & (IFA_F_MANAGETEMPADDR | IFA_F_TEMPORARY));
ipv6_privacy2 = !!(a2->n_ifa_flags & (IFA_F_MANAGETEMPADDR | IFA_F_TEMPORARY));
if (ipv6_privacy1 || ipv6_privacy2) {
gboolean prefer_temp = ((NMSettingIP6ConfigPrivacy) GPOINTER_TO_INT (user_data)) == NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR;
gboolean public1 = TRUE, public2 = TRUE;
if (ipv6_privacy1) {
if (a1->flags & IFA_F_TEMPORARY)
if (a1->n_ifa_flags & IFA_F_TEMPORARY)
public1 = prefer_temp;
else
public1 = !prefer_temp;
}
if (ipv6_privacy2) {
if (a2->flags & IFA_F_TEMPORARY)
if (a2->n_ifa_flags & IFA_F_TEMPORARY)
public2 = prefer_temp;
else
public2 = !prefer_temp;
......@@ -262,8 +262,8 @@ _addresses_sort_cmp (gconstpointer a, gconstpointer b, gpointer user_data)
return a1->source > a2->source ? -1 : 1;
/* sort permanent addresses before non-permanent. */
perm1 = (a1->flags & IFA_F_PERMANENT);
perm2 = (a2->flags & IFA_F_PERMANENT);
perm1 = (a1->n_ifa_flags & IFA_F_PERMANENT);
perm2 = (a2->n_ifa_flags & IFA_F_PERMANENT);
if (perm1 != perm2)
return perm1 ? -1 : 1;
......@@ -717,7 +717,7 @@ nm_ip6_config_destination_is_direct (const NMIP6Config *config, const struct in6
const NMPlatformIP6Address *item = nm_ip6_config_get_address (config, i);
if (item->plen <= plen && same_prefix (&item->address, network, item->plen) &&
!(item->flags & IFA_F_NOPREFIXROUTE))
!(item->n_ifa_flags & IFA_F_NOPREFIXROUTE))
return TRUE;
}
......@@ -1376,7 +1376,7 @@ nm_ip6_config_get_address_first_nontentative (const NMIP6Config *config, gboolea
const NMPlatformIP6Address *addr = &g_array_index (priv->addresses, NMPlatformIP6Address, i);
if ( ((!!IN6_IS_ADDR_LINKLOCAL (&addr->address)) == linklocal)
&& !(addr->flags & IFA_F_TENTATIVE))
&& !(addr->n_ifa_flags & IFA_F_TENTATIVE))
return addr;
}
......
......@@ -953,7 +953,7 @@ ip6_address_add (NMPlatform *platform,
address.timestamp = nm_utils_get_monotonic_timestamp_s ();
address.lifetime = lifetime;
address.preferred = preferred;
address.flags = flags;
address.n_ifa_flags = flags;
for (i = 0; i < priv->ip6_addresses->len; i++) {
NMPlatformIP6Address *item = &g_array_index (priv->ip6_addresses, NMPlatformIP6Address, i);
......
......@@ -1675,7 +1675,7 @@ _new_from_nl_addr (struct nlmsghdr *nlh, gboolean id_only)
obj->ip_address.source = NM_IP_CONFIG_SOURCE_KERNEL;
if (!is_v4) {
obj->ip6_address.flags = tb[IFA_FLAGS]
obj->ip6_address.n_ifa_flags = tb[IFA_FLAGS]
? nla_get_u32 (tb[IFA_FLAGS])
: ifa->ifa_flags;
}
......
......@@ -2469,7 +2469,7 @@ nm_platform_ip6_address_add (NMPlatform *self,
addr.timestamp = 0; /* set it to zero, which to_string will treat as *now* */
addr.lifetime = lifetime;
addr.preferred = preferred;
addr.flags = flags;
addr.n_ifa_flags = flags;
_LOGD ("address: adding or updating IPv6 address: %s", nm_platform_ip6_address_to_string (&addr, NULL, 0));
}
......@@ -2690,7 +2690,7 @@ nm_platform_ip6_address_sync (NMPlatform *self, int ifindex, const GArray *known
if (!nm_platform_ip6_address_add (self, ifindex, known_address->address,
known_address->plen, known_address->peer_address,
lifetime, preferred, known_address->flags))
lifetime, preferred, known_address->n_ifa_flags))
return FALSE;
}
......@@ -3478,7 +3478,7 @@ nm_platform_ip6_address_to_string (const NMPlatformIP6Address *address, char *bu
_to_string_dev (NULL, address->ifindex, str_dev, sizeof (str_dev));
nm_platform_addr_flags2str (address->flags, &s_flags[NM_STRLEN (S_FLAGS_PREFIX)], sizeof (s_flags) - NM_STRLEN (S_FLAGS_PREFIX));
nm_platform_addr_flags2str (address->n_ifa_flags, &s_flags[NM_STRLEN (S_FLAGS_PREFIX)], sizeof (s_flags) - NM_STRLEN (S_FLAGS_PREFIX));
if (s_flags[NM_STRLEN (S_FLAGS_PREFIX)] == '\0')
s_flags[0] = '\0';
else
......@@ -3846,7 +3846,7 @@ nm_platform_ip6_address_cmp (const NMPlatformIP6Address *a, const NMPlatformIP6A
_CMP_FIELD (a, b, timestamp);
_CMP_FIELD (a, b, lifetime);
_CMP_FIELD (a, b, preferred);
_CMP_FIELD (a, b, flags);
_CMP_FIELD (a, b, n_ifa_flags);
return 0;
}
......
......@@ -269,7 +269,7 @@ struct _NMPlatformIP6Address {
__NMPlatformIPAddress_COMMON;
struct in6_addr address;
struct in6_addr peer_address;
guint32 flags; /* ifa_flags from <linux/if_addr.h>, field type "unsigned int" is as used in rtnl_addr_get_flags. */
guint32 n_ifa_flags; /* ifa_flags from <linux/if_addr.h>, field type "unsigned int" is as used in rtnl_addr_get_flags. */
};
typedef union {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment