summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-02-29 15:36:12 +0100
committerThomas Haller <thaller@redhat.com>2016-02-29 16:27:08 +0100
commite18cdc10d379d7dfb2e4cc70496fda73ae8a3bea (patch)
treebb36d4839cd2c8e1532d4e8baf5266c23d947ddc
parent83d8a9e0944ed581b8e3e100acadcd137454dc9f (diff)
downloadNetworkManager-e18cdc10d379d7dfb2e4cc70496fda73ae8a3bea.tar.gz
platform: adjust type of IPv6 address flags to guint
Address flags inside 'struct ifaddrmsg' are uint8_t and they are extended to uint32_t via IFA_FLAGS. Change it to be guint32.
-rw-r--r--shared/nm-test-utils.h2
-rw-r--r--src/devices/nm-device.c2
-rw-r--r--src/nm-iface-helper.c2
-rw-r--r--src/platform/nm-fake-platform.c3
-rw-r--r--src/platform/nm-linux-platform.c6
-rw-r--r--src/platform/nm-platform.c2
-rw-r--r--src/platform/nm-platform.h6
-rw-r--r--src/platform/tests/test-cleanup.c2
-rw-r--r--src/platform/tests/test-common.c4
9 files changed, 15 insertions, 14 deletions
diff --git a/shared/nm-test-utils.h b/shared/nm-test-utils.h
index 85a2e2a369..90a83c23d8 100644
--- a/shared/nm-test-utils.h
+++ b/shared/nm-test-utils.h
@@ -1147,7 +1147,7 @@ nmtst_platform_ip6_address (const char *address, const char *peer_address, guint
inline static NMPlatformIP6Address *
nmtst_platform_ip6_address_full (const char *address, const char *peer_address, guint plen,
int ifindex, NMIPConfigSource source, guint32 timestamp,
- guint32 lifetime, guint32 preferred, guint flags)
+ guint32 lifetime, guint32 preferred, guint32 flags)
{
NMPlatformIP6Address *addr = nmtst_platform_ip6_address (address, peer_address, plen);
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 3c3b792e9c..6a51179bac 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -5627,7 +5627,7 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *self)
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
int i;
int system_support;
- guint ifa_flags = 0x00;
+ guint32 ifa_flags = 0x00;
/*
* Check, whether kernel is recent enough to help user space handling RA.
diff --git a/src/nm-iface-helper.c b/src/nm-iface-helper.c
index fc3292ae8a..b42f0ec885 100644
--- a/src/nm-iface-helper.c
+++ b/src/nm-iface-helper.c
@@ -134,7 +134,7 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, gpointer user_da
NMIP6Config *existing;
NMIP6Config *ip6_config;
static int system_support = -1;
- guint ifa_flags = 0x00;
+ guint32 ifa_flags = 0x00;
int i;
if (system_support == -1) {
diff --git a/src/platform/nm-fake-platform.c b/src/platform/nm-fake-platform.c
index d3cf767c11..f71b3e1f35 100644
--- a/src/platform/nm-fake-platform.c
+++ b/src/platform/nm-fake-platform.c
@@ -937,7 +937,8 @@ ip6_address_add (NMPlatform *platform,
int plen,
struct in6_addr peer_addr,
guint32 lifetime,
- guint32 preferred, guint flags)
+ guint32 preferred,
+ guint32 flags)
{
NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
NMPlatformIP6Address address;
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index 6ec13e0a70..5674fec455 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -1676,8 +1676,8 @@ _new_from_nl_addr (struct nlmsghdr *nlh, gboolean id_only)
if (!is_v4) {
obj->ip6_address.flags = tb[IFA_FLAGS]
- ? nla_get_u32 (tb[IFA_FLAGS])
- : ifa->ifa_flags;
+ ? nla_get_u32 (tb[IFA_FLAGS])
+ : ifa->ifa_flags;
}
if (is_v4) {
@@ -5214,7 +5214,7 @@ ip6_address_add (NMPlatform *platform,
struct in6_addr peer_addr,
guint32 lifetime,
guint32 preferred,
- guint flags)
+ guint32 flags)
{
NMPObject obj_id;
nm_auto_nlmsg struct nl_msg *nlmsg = NULL;
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index 4037b3251d..e40ceec004 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -2450,7 +2450,7 @@ nm_platform_ip6_address_add (NMPlatform *self,
struct in6_addr peer_address,
guint32 lifetime,
guint32 preferred,
- guint flags)
+ guint32 flags)
{
_CHECK_SELF (self, klass, FALSE);
diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h
index e11d5411d0..16d28b3fc6 100644
--- a/src/platform/nm-platform.h
+++ b/src/platform/nm-platform.h
@@ -269,7 +269,7 @@ struct _NMPlatformIP6Address {
__NMPlatformIPAddress_COMMON;
struct in6_addr address;
struct in6_addr peer_address;
- guint flags; /* ifa_flags from <linux/if_addr.h>, field type "unsigned int" is as used in rtnl_addr_get_flags. */
+ guint32 flags; /* ifa_flags from <linux/if_addr.h>, field type "unsigned int" is as used in rtnl_addr_get_flags. */
};
typedef union {
@@ -594,7 +594,7 @@ typedef struct {
struct in6_addr peer_address,
guint32 lifetime,
guint32 preferred_lft,
- guint flags);
+ guint32 flags);
gboolean (*ip4_address_delete) (NMPlatform *, int ifindex, in_addr_t address, int plen, in_addr_t peer_address);
gboolean (*ip6_address_delete) (NMPlatform *, int ifindex, struct in6_addr address, int plen);
const NMPlatformIP4Address *(*ip4_address_get) (NMPlatform *, int ifindex, in_addr_t address, int plen, in_addr_t peer_address);
@@ -861,7 +861,7 @@ gboolean nm_platform_ip6_address_add (NMPlatform *self,
struct in6_addr peer_address,
guint32 lifetime,
guint32 preferred_lft,
- guint flags);
+ guint32 flags);
gboolean nm_platform_ip4_address_delete (NMPlatform *self, int ifindex, in_addr_t address, int plen, in_addr_t peer_address);
gboolean nm_platform_ip6_address_delete (NMPlatform *self, int ifindex, struct in6_addr address, int plen);
gboolean nm_platform_ip4_address_sync (NMPlatform *self, int ifindex, const GArray *known_addresses, GPtrArray **out_added_addresses);
diff --git a/src/platform/tests/test-cleanup.c b/src/platform/tests/test-cleanup.c
index 4025467337..6ad2447806 100644
--- a/src/platform/tests/test-cleanup.c
+++ b/src/platform/tests/test-cleanup.c
@@ -45,7 +45,7 @@ test_cleanup_internal (void)
int preferred = NM_PLATFORM_LIFETIME_PERMANENT;
int metric = 20;
int mss = 1000;
- guint flags = 0;
+ guint32 flags = 0;
inet_pton (AF_INET, "192.0.2.1", &addr4);
inet_pton (AF_INET, "192.0.3.0", &network4);
diff --git a/src/platform/tests/test-common.c b/src/platform/tests/test-common.c
index 48074e9cd2..268a5c92d1 100644
--- a/src/platform/tests/test-common.c
+++ b/src/platform/tests/test-common.c
@@ -564,7 +564,7 @@ _ip_address_add (gboolean external_command,
guint32 lifetime,
guint32 preferred,
const char *label,
- guint flags)
+ guint32 flags)
{
gint64 end_time;
@@ -1028,7 +1028,7 @@ nmtstp_ip6_address_add (gboolean external_command,
struct in6_addr peer_address,
guint32 lifetime,
guint32 preferred,
- guint flags)
+ guint32 flags)
{
_ip_address_add (external_command,
FALSE,