summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-09-11 19:29:24 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-09-11 19:35:26 +0200
commit0a16efff9bb19e617e861fbcae6b772e67e6b500 (patch)
tree85506b0db435b8cf3fcb00df9647b24739f1f176 /zebra
parentzebra: Fixup indentation (diff)
downloadfrr-0a16efff9bb19e617e861fbcae6b772e67e6b500.tar.xz
frr-0a16efff9bb19e617e861fbcae6b772e67e6b500.zip
zebra: Fix rib_update_table
We should only be operating RIB_UPDATE_IF_CHANGE on types that zebra has control of. We assume that the calling routing protocol is going to take care of their own route changes based upon the interface state change. Also try to re-organize the code a tiny bit to allow it to fit better within a tabed world. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_rib.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 9dc0630c8..376425329 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -2553,27 +2553,29 @@ static void rib_update_table(struct route_table *table,
*/
RNODE_FOREACH_RE_SAFE(rn, re, next)
{
- if (re->type == ZEBRA_ROUTE_OSPF
- || re->type == ZEBRA_ROUTE_OSPF6
- || re->type == ZEBRA_ROUTE_BGP)
- continue; /* protocol will handle. */
- else if (re->type == ZEBRA_ROUTE_STATIC) {
- struct nexthop *nh;
- for (nh = re->nexthop; nh;
- nh = nh->next)
- if (!(nh->type
- == NEXTHOP_TYPE_IPV4
- || nh->type
- == NEXTHOP_TYPE_IPV6))
- break;
-
- /* If we only have nexthops to a
- * gateway, NHT will
- * take care.
- */
- if (nh)
- rib_queue_add(rn);
- } else
+ struct nexthop *nh;
+
+ if (re->type != ZEBRA_ROUTE_SYSTEM &&
+ re->type != ZEBRA_ROUTE_KERNEL &&
+ re->type != ZEBRA_ROUTE_CONNECT &&
+ re->type != ZEBRA_ROUTE_STATIC)
+ continue;
+
+ if (re->type != ZEBRA_ROUTE_STATIC) {
+ rib_queue_add(rn);
+ continue;
+ }
+
+ for (nh = re->nexthop; nh; nh = nh->next)
+ if (!(nh->type == NEXTHOP_TYPE_IPV4
+ || nh->type == NEXTHOP_TYPE_IPV6))
+ break;
+
+ /* If we only have nexthops to a
+ * gateway, NHT will
+ * take care.
+ */
+ if (nh)
rib_queue_add(rn);
}
break;