Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zebra: Fix leaked nhe #17809

Merged
merged 1 commit into from
Jan 9, 2025
Merged

zebra: Fix leaked nhe #17809

merged 1 commit into from
Jan 9, 2025

Conversation

donaldsharp
Copy link
Member

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.

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 <[email protected]>
@Jafaral
Copy link
Member

Jafaral commented Jan 9, 2025

@Mergifyio backport stable/10.0 stable/10.1 stable/10.2

Copy link

mergify bot commented Jan 9, 2025

backport stable/10.0 stable/10.1 stable/10.2

✅ Backports have been created

@Jafaral Jafaral merged commit 34431a3 into FRRouting:master Jan 9, 2025
14 checks passed
Jafaral added a commit that referenced this pull request Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants