aboutsummaryrefslogtreecommitdiffstats
path: root/src/libhydra/plugins/kernel_netlink
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2012-10-16 12:38:54 +0200
committerTobias Brunner <tobias@strongswan.org>2012-10-18 12:25:59 +0200
commiteecd41e349dd13e3eae2d49eeade5803fdf73773 (patch)
tree4024be4969935e8c3d6bc73ed3d6bae573f8aa89 /src/libhydra/plugins/kernel_netlink
parent2b6088c7187f30479ef20d305e1972abe3d5a40a (diff)
downloadstrongswan-eecd41e349dd13e3eae2d49eeade5803fdf73773.tar.bz2
strongswan-eecd41e349dd13e3eae2d49eeade5803fdf73773.tar.xz
Use a helper function to add milliseconds to timeval structs
Diffstat (limited to 'src/libhydra/plugins/kernel_netlink')
-rw-r--r--src/libhydra/plugins/kernel_netlink/kernel_netlink_net.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/libhydra/plugins/kernel_netlink/kernel_netlink_net.c b/src/libhydra/plugins/kernel_netlink/kernel_netlink_net.c
index 3f63a8496..e5f070e13 100644
--- a/src/libhydra/plugins/kernel_netlink/kernel_netlink_net.c
+++ b/src/libhydra/plugins/kernel_netlink/kernel_netlink_net.c
@@ -543,12 +543,7 @@ static void queue_route_reinstall(private_kernel_netlink_net_t *this,
time_monotonic(&now);
if (timercmp(&now, &this->last_route_reinstall, >))
{
- now.tv_usec += ROUTE_DELAY * 1000;
- while (now.tv_usec > 1000000)
- {
- now.tv_sec++;
- now.tv_usec -= 1000000;
- }
+ timeval_add_ms(&now, ROUTE_DELAY);
this->last_route_reinstall = now;
job = (job_t*)callback_job_create((callback_job_cb_t)reinstall_routes,
@@ -704,12 +699,7 @@ static void fire_roam_event(private_kernel_netlink_net_t *this, bool address)
this->roam_lock->unlock(this->roam_lock);
return;
}
- now.tv_usec += ROAM_DELAY * 1000;
- while (now.tv_usec > 1000000)
- {
- now.tv_sec++;
- now.tv_usec -= 1000000;
- }
+ timeval_add_ms(&now, ROAM_DELAY);
this->next_roam = now;
this->roam_lock->unlock(this->roam_lock);