From: Donald Sharp Date: Wed, 20 May 2015 00:47:25 +0000 (-0700) Subject: bgpd-delete-route-on-invalid-nh.patch X-Git-Tag: frr-2.0-rc1~1503 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=76145957957916bbb4d0ca33018084b5203528a5;p=matthieu%2Ffrr.git bgpd-delete-route-on-invalid-nh.patch BGPd: Delete the route from the kernel when a valid NH changes to invalid NH A route has been announced by a BGP peer with a valid NH and has been populated into the kernel. Now, if the NH announced changes (say via routemap) to an invalid NH, the route is marked as inactive/inaccessible inside Quagga, but is not deleted from the kernel. This patch fixes that issue. The problem is caused by BGP losing the old valid NH and using the new, invalid NH to delete the now-inaccessible route. However, the kernel/zebra has the route using the old NH and so they reject the delete. Fix involves not sending the invalid NH when its the only NH. Things worked fine if the route had BGP multipath. --- diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index bd63c6790c..3c81d638ce 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1312,8 +1312,8 @@ bgp_zebra_withdraw (struct prefix *p, struct bgp_info *info, safi_t safi) api.message = 0; api.safi = safi; SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP); - api.nexthop_num = 1; - api.nexthop = &nexthop; + api.nexthop_num = 0; + api.nexthop = NULL; api.ifindex_num = 0; SET_FLAG (api.message, ZAPI_MESSAGE_METRIC); api.metric = info->attr->med;