]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: fix merging flex-algo route nodes
authorEric Kinzie <ekinzie@labn.net>
Fri, 1 Apr 2022 00:47:30 +0000 (00:47 +0000)
committerLouis Scalbert <louis.scalbert@6wind.com>
Tue, 18 Apr 2023 09:33:15 +0000 (11:33 +0200)
As isis_route_verify_merge() builds a new route table, each (src,dst)
new node in the table is created by merging data from the same (src,dst)
pair present in all route tables.  However, as it iterates over those
route nodes and copies SR data into the newly created node, it repeatedly
overwrites the isis_route_info pointer.  This, in turn, pollutes the
isis_route_info structures in all of the other tables with partially
updated SR data.

After a route is deleted, this leaves pointers to freed memory in one
of the route trees.

Fixes: 26b0598f6b6f ("isisd: fix isis_route_merge_verify logic")
Signed-off-by: Eric Kinzie <ekinzie@labn.net>
isisd/isis_route.c

index 3983c704ce65b2bf593916bd38990be855ae15c3..be92dcc22ef6ca5694775f34165238564855c038 100644 (file)
@@ -889,8 +889,9 @@ static void _isis_route_verify_merge(struct isis_area *area,
                                                ISIS_ROUTE_FLAG_ZEBRA_SYNCED)) {
                                        continue;
                                }
+                       } else {
+                               mrnode->info = rnode->info;
                        }
-                       mrnode->info = rnode->info;
                }
        }