diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2018-10-23 12:42:42 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2018-10-23 12:42:42 +0200 |
| commit | cd5f56bb4e653dae0219121fec5ea922d871355b (patch) | |
| tree | 672545af896a6043bd36c44c31d3ef03c3bea3c7 /zebra/zebra_rib.c | |
| parent | 064518517c57024e65e177ee79c0a98f9f28ef6e (diff) | |
| parent | ef57f35f419f1ec6ec0dc90b07c9f1117aafa93a (diff) | |
Merge branch 'pull/3165'
...with an additional comment.
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 05419ee4bf..db610098f0 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -878,6 +878,9 @@ int rib_lookup_ipv4_route(struct prefix_ipv4 *p, union sockunion *qgate, #define RIB_SYSTEM_ROUTE(R) \ ((R)->type == ZEBRA_ROUTE_KERNEL || (R)->type == ZEBRA_ROUTE_CONNECT) +#define RIB_KERNEL_ROUTE(R) \ + ((R)->type == ZEBRA_ROUTE_KERNEL) + /* This function verifies reachability of one given nexthop, which can be * numbered or unnumbered, IPv4 or IPv6. The result is unconditionally stored * in nexthop->flags field. If the 4th parameter, 'set', is non-zero, @@ -1408,8 +1411,15 @@ static void rib_process_del_fib(struct zebra_vrf *zvrf, struct route_node *rn, } /* Update nexthop for route, reset changed flag. */ - nexthop_active_update(rn, old, 1); - UNSET_FLAG(old->status, ROUTE_ENTRY_CHANGED); + /* Note: this code also handles the Linux case when an interface goes + * down, causing the kernel to delete routes without sending DELROUTE + * notifications + */ + if (!nexthop_active_update(rn, old, 1) && + (RIB_KERNEL_ROUTE(old))) + SET_FLAG(old->status, ROUTE_ENTRY_REMOVED); + else + UNSET_FLAG(old->status, ROUTE_ENTRY_CHANGED); } static void rib_process_update_fib(struct zebra_vrf *zvrf, |
