summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-03-20 12:58:21 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2009-03-20 12:58:21 +0100
commit3d574679b8cceb1362bb973e7dfe9981fc93b79b (patch)
treee3e8377246c9f8c2c9ffc39ca4e826aba993ca64
parent48d79d521cc13f11eafa129a4216512403b83115 (diff)
Fix bugs related to kernel table synchronization.
KRF_INSTALLED flag was not cleared during reconfiguration that lead to not removing routes during reconfigure when export rules changed. We also should not try to remove routes we didi not installed, on Linux this leads to warnings (as kernel checks route source field and do not allow to remove non-bird routes) but we should not rely on it.
-rw-r--r--sysdep/unix/krt.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index 816eb444..83456b0f 100644
--- a/sysdep/unix/krt.c
+++ b/sysdep/unix/krt.c
@@ -462,8 +462,12 @@ krt_flush_routes(struct krt_proto *p)
if (e)
{
rta *a = e->attrs;
- if (a->source != RTS_DEVICE && a->source != RTS_INHERIT)
- krt_set_notify(p, e->net, NULL, e);
+ if ((n->n.flags & KRF_INSTALLED) &&
+ a->source != RTS_DEVICE && a->source != RTS_INHERIT)
+ {
+ krt_set_notify(p, e->net, NULL, e);
+ n->n.flags &= ~KRF_INSTALLED;
+ }
}
}
FIB_WALK_END;
@@ -795,7 +799,8 @@ krt_shutdown(struct proto *P)
#endif
tm_stop(p->scan_timer);
- if (!KRT_CF->persist)
+ /* FIXME we should flush routes even when persist during reconfiguration */
+ if (p->initialized && !KRT_CF->persist)
krt_flush_routes(p);
krt_set_shutdown(p, last);