rdisc: set the expiration timer correctly (rh #1073560)

check_timestamps() was mixing up absolute and relative timestamps,
which meant that IPv6 expiration checks more-or-less stopped happening
after a while, allowing expired IPv6 routes, etc, to remain applied.
This commit is contained in:
Dan Winship
2014-03-06 11:58:50 -05:00
parent 269ab02081
commit 5ec9b9e97c

View File

@@ -402,8 +402,10 @@ check_timestamps (NMRDisc *rdisc, guint32 now, NMRDiscConfigMap changed)
g_signal_emit_by_name (rdisc, NM_RDISC_CONFIG_CHANGED, changed);
if (nextevent != never) {
debug ("(%s): scheduling next now/lifetime check: %u seconds", rdisc->ifname, nextevent);
priv->timeout_id = g_timeout_add_seconds (nextevent, timeout_cb, rdisc);
g_return_if_fail (nextevent > now);
debug ("(%s): scheduling next now/lifetime check: %u seconds",
rdisc->ifname, nextevent - now);
priv->timeout_id = g_timeout_add_seconds (nextevent - now, timeout_cb, rdisc);
}
}