]> git.puffer.fish Git - matthieu/frr.git/commit
zebra: Fix leaked nhe
authorDonald Sharp <sharpd@nvidia.com>
Thu, 9 Jan 2025 17:34:50 +0000 (12:34 -0500)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 9 Jan 2025 21:40:29 +0000 (21:40 +0000)
commit2329248542e09db635f34f29d0909fe0a8d7a84f
treef35d2836b81b57c95d3b57fbc5d651a1a3b06f14
parent3401b883b75c9fea7eaa437bc568701516c62e01
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>
(cherry picked from commit 97fa24e70b35bdfb99b9efc163dbcb5c09242527)
zebra/zebra_nhg.c