summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2019-03-21 14:26:54 -0400
committerMark Stapp <mjs@voltanet.io>2019-04-10 16:07:01 -0400
commitcf363e1bd86a2594aa3698d4e6561cfe14ea7d9a (patch)
tree405c3e9d7b8798c92cb83df16a476acdc40e183a /zebra/zebra_rib.c
parentc8d8450442fbc9967a2e9cbbb5a963dc2ff3de00 (diff)
zebra: dataplane notifications for system route changes
Add notifications from zebra to the dataplane subsystem when kernel or connected routes change. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 9f57e15882..e47499b065 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -2799,6 +2799,12 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
break;
}
+ /* If this route is kernel/connected route, notify the dataplane. */
+ if (RIB_SYSTEM_ROUTE(re)) {
+ /* Notify dataplane */
+ dplane_sys_route_add(rn, re);
+ }
+
/* Link new re to node.*/
if (IS_ZEBRA_DEBUG_RIB) {
rnode_debug(rn, re->vrf_id,
@@ -3010,6 +3016,11 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
&vtep_ip, p);
}
}
+
+ /* Notify dplane if system route changes */
+ if (RIB_SYSTEM_ROUTE(re))
+ dplane_sys_route_del(rn, same);
+
rib_delnode(rn, same);
}
@@ -3355,6 +3366,12 @@ static int rib_process_dplane_results(struct thread *thread)
handle_pw_result(ctx);
break;
+ case DPLANE_OP_SYS_ROUTE_ADD:
+ case DPLANE_OP_SYS_ROUTE_DELETE:
+ /* No further processing in zebra for these. */
+ dplane_ctx_fini(&ctx);
+ break;
+
default:
/* Don't expect this: just return the struct? */
dplane_ctx_fini(&ctx);