From: Igor Ryzhov Date: Thu, 17 Jun 2021 16:31:03 +0000 (+0300) Subject: ospfd: fix routemap update X-Git-Tag: frr-8.0~12^2~6 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b28a86edd5e99ead5f1c201844a4c67f52a0d7fa;p=matthieu%2Ffrr.git ospfd: fix routemap update Currently, if the routemap already exists, we delete the pointer to it when it is updated. We should delete the pointer only if the route-map is actually deleted. Signed-off-by: Igor Ryzhov --- diff --git a/ospfd/ospf_routemap.c b/ospfd/ospf_routemap.c index d3b114840e..2525c1cf3a 100644 --- a/ospfd/ospf_routemap.c +++ b/ospfd/ospf_routemap.c @@ -71,19 +71,14 @@ static void ospf_route_map_update(const char *name) /* Keep old route-map. */ struct route_map *old = ROUTEMAP(red); - if (!old) { - /* Route-map creation */ - /* Update route-map. */ - ROUTEMAP(red) = - route_map_lookup_by_name( - ROUTEMAP_NAME(red)); - - route_map_counter_increment( - ROUTEMAP(red)); - } else { - /* Route-map deletion */ - ROUTEMAP(red) = NULL; - } + ROUTEMAP(red) = + route_map_lookup_by_name( + ROUTEMAP_NAME(red)); + + if (!old) + route_map_counter_increment( + ROUTEMAP(red)); + /* No update for this distribute type. */ if (old == NULL