guint32
nm_utils_lifetime_rebase_relative_time_on_now (guint32 timestamp,
guint32 duration,
- guint32 now)
+ gint32 now)
{
gint64 t;
+ nm_assert (now >= 0);
+
if (duration == NM_PLATFORM_LIFETIME_PERMANENT)
return NM_PLATFORM_LIFETIME_PERMANENT;
nm_utils_lifetime_get (guint32 timestamp,
guint32 lifetime,
guint32 preferred,
- guint32 now,
+ gint32 now,
guint32 *out_lifetime,
guint32 *out_preferred)
{
guint32 t_lifetime, t_preferred;
+ nm_assert (now >= 0);
+
if (lifetime == 0) {
*out_lifetime = NM_PLATFORM_LIFETIME_PERMANENT;
*out_preferred = NM_PLATFORM_LIFETIME_PERMANENT;
* In that case we also expect that the other fields (timestamp and preferred) are left unset. */
g_return_val_if_fail (timestamp == 0 && preferred == 0, TRUE);
} else {
- if (!now)
+ if (now <= 0)
now = nm_utils_get_monotonic_timestamp_s ();
t_lifetime = nm_utils_lifetime_rebase_relative_time_on_now (timestamp, lifetime, now);
if (!t_lifetime) {
guint32 nm_utils_lifetime_rebase_relative_time_on_now (guint32 timestamp,
guint32 duration,
- guint32 now);
+ gint32 now);
gboolean nm_utils_lifetime_get (guint32 timestamp,
guint32 lifetime,
guint32 preferred,
- guint32 now,
+ gint32 now,
guint32 *out_lifetime,
guint32 *out_preferred);
}
static gboolean
-array_contains_ip4_address (const GArray *addresses, const NMPlatformIP4Address *address, gint64 now)
+array_contains_ip4_address (const GArray *addresses, const NMPlatformIP4Address *address, gint32 now)
{
guint len = addresses ? addresses->len : 0;
guint i;
}
static gboolean
-array_contains_ip6_address (const GArray *addresses, const NMPlatformIP6Address *address, gint64 now)
+array_contains_ip6_address (const GArray *addresses, const NMPlatformIP6Address *address, gint32 now)
{
guint len = addresses ? addresses->len : 0;
guint i;
{
GArray *addresses;
NMPlatformIP4Address *address;
- guint32 now = nm_utils_get_monotonic_timestamp_s ();
+ gint32 now = nm_utils_get_monotonic_timestamp_s ();
int i;
_CHECK_SELF (self, klass, FALSE);
{
GArray *addresses;
NMPlatformIP6Address *address;
- guint32 now = nm_utils_get_monotonic_timestamp_s ();
+ gint32 now = nm_utils_get_monotonic_timestamp_s ();
int i;
/* Delete unknown addresses */