Skip to content

Commit 0fddd86

Browse files
committed
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 <[email protected]>
1 parent 9b1bc4d commit 0fddd86

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

ospfd/ospf_routemap.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,14 @@ static void ospf_route_map_update(const char *name)
7171
/* Keep old route-map. */
7272
struct route_map *old = ROUTEMAP(red);
7373

74-
if (!old) {
75-
/* Route-map creation */
76-
/* Update route-map. */
77-
ROUTEMAP(red) =
78-
route_map_lookup_by_name(
79-
ROUTEMAP_NAME(red));
80-
81-
route_map_counter_increment(
82-
ROUTEMAP(red));
83-
} else {
84-
/* Route-map deletion */
85-
ROUTEMAP(red) = NULL;
86-
}
74+
ROUTEMAP(red) =
75+
route_map_lookup_by_name(
76+
ROUTEMAP_NAME(red));
77+
78+
if (!old)
79+
route_map_counter_increment(
80+
ROUTEMAP(red));
81+
8782
/* No update for this distribute type.
8883
*/
8984
if (old == NULL

0 commit comments

Comments
 (0)