From fb78b671d71ec7b6a0bef5e1c1497a9aded687bc Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 5 Nov 2014 12:37:37 -0600 Subject: [PATCH] platform: fix lifetime/preferred type in _address_get_lifetime() They are defined as gint32 but are assigned a guint32 value and then immediately passed back to the caller of _address_get_lifetime() as guint32. They can never be negative, and may receive values greater than G_MAXINT32, so they should be unsigned. --- src/platform/nm-platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index 5d478e87d4..1aa72a4dba 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -1698,7 +1698,7 @@ _rebase_relative_time_on_now (guint32 timestamp, guint32 duration, guint32 now, static gboolean _address_get_lifetime (const NMPlatformIPAddress *address, guint32 now, guint32 padding, guint32 *out_lifetime, guint32 *out_preferred) { - gint32 lifetime, preferred; + guint32 lifetime, preferred; if (address->lifetime == 0) { *out_lifetime = NM_PLATFORM_LIFETIME_PERMANENT;