]> git.puffer.fish Git - mirror/frr.git/commit
zebra: Fix leaked nhe 17809/head
authorDonald Sharp <sharpd@nvidia.com>
Thu, 9 Jan 2025 17:34:50 +0000 (12:34 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 9 Jan 2025 17:34:50 +0000 (12:34 -0500)
commit97fa24e70b35bdfb99b9efc163dbcb5c09242527
tree1027e83d32a8786b1a81dcbf72672629f8e59940
parent465d286819fe532bd4ff33ee20e7127672e9d07b
zebra: Fix leaked nhe

During route processing in zebra, Zebra will create a nexthop
group that matches the nexthops passed down from the routing
protocol.  Then Zebra will look to see if it can re-use a
nhe from a previous version of the route entry( say a interface
goes down ).  If Zebra decides to re-use an nhe it was just dropping
the route entry created.  Which led to nexthop group's that had
a refcount of 0 and in some cases these nexthop groups were installed
into the kernel.

Add a bit of code to see if the returned entry is not being used
and it has no reference count and if so, properly dispose of it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/zebra_nhg.c