summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
authorDenis Ovsienko <linux@pilot.org.ua>2007-11-12 14:55:01 +0000
committerDenis Ovsienko <linux@pilot.org.ua>2007-11-12 14:55:01 +0000
commit6ce80bdb2523ad82cef813f6d8a7e0d4daa8cfae (patch)
treed0b0fc8725c9f120cdcc16fa7f711d8104051815 /zebra
parent3a02d1f7fb778a1ea4f45d037f13dfcd126e2337 (diff)
+ fixed bug #418 (changing address on an existing interface doesn't cause existing static routes to be revalidated)
Diffstat (limited to 'zebra')
-rw-r--r--zebra/ChangeLog7
-rw-r--r--zebra/connected.c15
2 files changed, 22 insertions, 0 deletions
diff --git a/zebra/ChangeLog b/zebra/ChangeLog
index e152729d..3ce7b9ea 100644
--- a/zebra/ChangeLog
+++ b/zebra/ChangeLog
@@ -1,3 +1,10 @@
+2007-11-12 Denis Ovsienko
+
+ * connected.c: (connected_up_ipv4, connected_down_ipv4,
+ connected_up_ipv6, connected_down_ipv6) Collect all changed
+ connected routes closest possible to the RIB work queue, so
+ that the rest can be revalidated correctly.
+
2007-10-24 Denis Ovsienko
* kernel_socket.c: (rtm_read) we used to ignore own messages,
diff --git a/zebra/connected.c b/zebra/connected.c
index 53aa2543..8bf1d337 100644
--- a/zebra/connected.c
+++ b/zebra/connected.c
@@ -35,6 +35,7 @@
#include "zebra/redistribute.h"
#include "zebra/interface.h"
#include "zebra/connected.h"
+extern struct zebra_t zebrad;
/* withdraw a connected address */
static void
@@ -187,8 +188,15 @@ connected_up_ipv4 (struct interface *ifp, struct connected *ifc)
if (prefix_ipv4_any (&p))
return;
+ /* Always push arriving/departing connected routes into the head of
+ * the working queue to make possible proper validation of the rest
+ * of the RIB queue (which will contain the whole RIB after the first
+ * call to rib_update()).
+ */
+ work_queue_aim_head (zebrad.ribq, 1);
rib_add_ipv4 (ZEBRA_ROUTE_CONNECT, 0, &p, NULL, NULL, ifp->ifindex,
RT_TABLE_MAIN, ifp->metric, 0);
+ work_queue_aim_head (zebrad.ribq, 0);
rib_update ();
}
@@ -293,7 +301,10 @@ connected_down_ipv4 (struct interface *ifp, struct connected *ifc)
if (prefix_ipv4_any (&p))
return;
+ /* Same logic as for connected_up_ipv4(): push the changes into the head. */
+ work_queue_aim_head (zebrad.ribq, 1);
rib_delete_ipv4 (ZEBRA_ROUTE_CONNECT, 0, &p, NULL, ifp->ifindex, 0);
+ work_queue_aim_head (zebrad.ribq, 0);
rib_update ();
}
@@ -338,8 +349,10 @@ connected_up_ipv6 (struct interface *ifp, struct connected *ifc)
return;
#endif
+ work_queue_aim_head (zebrad.ribq, 1);
rib_add_ipv6 (ZEBRA_ROUTE_CONNECT, 0, &p, NULL, ifp->ifindex, 0,
ifp->metric, 0);
+ work_queue_aim_head (zebrad.ribq, 0);
rib_update ();
}
@@ -413,7 +426,9 @@ connected_down_ipv6 (struct interface *ifp, struct connected *ifc)
if (IN6_IS_ADDR_UNSPECIFIED (&p.prefix))
return;
+ work_queue_aim_head (zebrad.ribq, 1);
rib_delete_ipv6 (ZEBRA_ROUTE_CONNECT, 0, &p, NULL, ifp->ifindex, 0);
+ work_queue_aim_head (zebrad.ribq, 0);
rib_update ();
}