diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-08-26 05:21:40 -0700 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-08-26 05:21:40 -0700 |
| commit | 6baf7bb88b1b02221b2d213d089f1077aae4ee1d (patch) | |
| tree | 12975c88bc6f3504d3ba831f3edca7cfb2993d17 /zebra/zebra_rib.c | |
| parent | c44e65bd3ffc2c342c96c7a12dd2fa4f5880a841 (diff) | |
Create override for quagga reinstall of originated routes
Ticket: CM-7026
Reviewed by: CCR-3315
Testing: See bug
Quagga-dev suggested these changes for the quagga override of originated routes.
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 41a7f68b88..416c1dcf7b 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -48,6 +48,9 @@ /* Default rtm_table for all clients */ extern struct zebra_t zebrad; +/* Should we allow non Quagga processes to delete our routes */ +extern int allow_delete; + /* Hold time for RIB process, should be very minimal. * it is useful to able to set it otherwise for testing, hence exported * as global here for test-rig code. @@ -2695,9 +2698,20 @@ rib_delete_ipv4 (int type, u_short instance, int flags, struct prefix_ipv4 *p, inet_ntop (AF_INET, &p->prefix, buf1, INET_ADDRSTRLEN), p->prefixlen); } - /* This means someone else, other than Zebra, has deleted - * a Zebra router from the kernel. We will add it back */ - rib_install_kernel(rn, fib, 0); + if (allow_delete) + { + /* Unset flags. */ + for (nexthop = fib->nexthop; nexthop; nexthop = nexthop->next) + UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB); + + UNSET_FLAG (fib->flags, ZEBRA_FLAG_SELECTED); + } + else + { + /* This means someone else, other than Zebra, has deleted + * a Zebra router from the kernel. We will add it back */ + rib_install_kernel(rn, fib, 0); + } } else { @@ -3448,9 +3462,20 @@ rib_delete_ipv6 (int type, u_short instance, int flags, struct prefix_ipv6 *p, inet_ntop (AF_INET, &p->prefix, buf1, INET_ADDRSTRLEN), p->prefixlen); } - /* This means someone else, other than Zebra, has deleted a Zebra - * route from the kernel. We will add it back */ - rib_install_kernel(rn, fib, 0); + if (allow_delete) + { + /* Unset flags. */ + for (nexthop = fib->nexthop; nexthop; nexthop = nexthop->next) + UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB); + + UNSET_FLAG (fib->flags, ZEBRA_FLAG_SELECTED); + } + else + { + /* This means someone else, other than Zebra, has deleted a Zebra + * route from the kernel. We will add it back */ + rib_install_kernel(rn, fib, 0); + } } else { |
