kernel-netlink,pfroute: Properly update address flag within ROAM_DELAY
authorTobias Brunner <tobias@strongswan.org>
Mon, 12 Aug 2013 10:06:25 +0000 (12:06 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 12 Aug 2013 10:08:23 +0000 (12:08 +0200)
77d4a02 and 55da01f only updated the address flag when a job was created,
which obviously had the same limitation as the old code.

Fixes #374.

src/libhydra/plugins/kernel_netlink/kernel_netlink_net.c
src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c

index 89fb076..43bcb67 100644 (file)
@@ -729,6 +729,7 @@ static void fire_roam_event(private_kernel_netlink_net_t *this, bool address)
 
        time_monotonic(&now);
        this->roam_lock->lock(this->roam_lock);
+       this->roam_address |= address;
        if (!timercmp(&now, &this->next_roam, >))
        {
                this->roam_lock->unlock(this->roam_lock);
@@ -736,7 +737,6 @@ static void fire_roam_event(private_kernel_netlink_net_t *this, bool address)
        }
        timeval_add_ms(&now, ROAM_DELAY);
        this->next_roam = now;
-       this->roam_address |= address;
        this->roam_lock->unlock(this->roam_lock);
 
        job = (job_t*)callback_job_create((callback_job_cb_t)roam_event,
index 05aeb90..f432ecd 100644 (file)
@@ -565,6 +565,7 @@ static void fire_roam_event(private_kernel_pfroute_net_t *this, bool address)
 
        time_monotonic(&now);
        this->roam_lock->lock(this->roam_lock);
+       this->roam_address |= address;
        if (!timercmp(&now, &this->next_roam, >))
        {
                this->roam_lock->unlock(this->roam_lock);
@@ -572,7 +573,6 @@ static void fire_roam_event(private_kernel_pfroute_net_t *this, bool address)
        }
        timeval_add_ms(&now, ROAM_DELAY);
        this->next_roam = now;
-       this->roam_address |= address;
        this->roam_lock->unlock(this->roam_lock);
 
        job = (job_t*)callback_job_create((callback_job_cb_t)roam_event,