Fixed missing periodic-ras in some configurations.
diff --git a/CHANGELOG b/CHANGELOG
index e810306..6c3f0e3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,6 +4,10 @@
 	    Cope with router-solict packets wich don't have a valid 
 	    source address. Thanks to Vladislav Grishenko for the patch.
 
+	    Fixed bug which caused missing periodic router
+	    advertisements with some configurations. Thanks to
+	    Vladislav Grishenko for the patch.
+
 
 version 2.61
 	    Re-write interface discovery code on *BSD to use
diff --git a/src/lease.c b/src/lease.c
index aeb589e..cff24a2 100644
--- a/src/lease.c
+++ b/src/lease.c
@@ -310,12 +310,19 @@
   /* do timed RAs and determine when the next is, also pings to potential SLAAC addresses */
   if (daemon->ra_contexts)
     {
-      time_t ra_event = periodic_slaac(now, leases);
+      time_t event;
       
-      next_event = periodic_ra(now);
+      if ((event = periodic_slaac(now, leases)) != 0)
+	{
+	  if (next_event == 0 || difftime(next_event, event) > 0.0)
+	    next_event = event;
+	}
       
-      if (next_event == 0 || difftime(next_event, ra_event) > 0.0)
-	next_event = ra_event;
+      if ((event = periodic_ra(now)) != 0)
+	{
+	  if (next_event == 0 || difftime(next_event, event) > 0.0)
+	    next_event = event;
+	}
     }
 #endif