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

[10.4 stable] Backport recent zedrouter bug fixes #3472

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

milan-zededa
Copy link
Contributor

Backport of zedrouter bug fixes from PRs: #3468 and #3465

…ange

If number allocated for app interface (aka application underlay network)
produces IP address outside of DHCP range (meaning that there is no free
IP address left at the moment), then the number should be freed before
trying to create the app again after another app was deleted.
This way zedrouter will reuse interface number from the deleted app
and therefore it will also reuse freed IP address (and the retry attempt
to create the new app will succeed).
Otherwise, zedrouter would just try to use the same IP address outside
the DHCP range and fail repeatedly, even if there is a free IP available
after deletion of another app.

Signed-off-by: Milan Lenco <[email protected]>
(cherry picked from commit 7bf73ae)
Currently, we have to remember to set PendingAdd/PendingModify inside
AppNetworkStatus to false just before the corresponding handler returns.
However, there are few error branches where we forgot to clear
the pending flag. This causes zedmanager to just wait and not report
the error published inside the AppNetworkStatus.
Instead of fixing this case-by-case, let's take advantage of 'defer'
to make sure that we will never forget to clear the Pending flag,
even if a new branch with return statement is added in the future.

Signed-off-by: Milan Lenco <[email protected]>
(cherry picked from commit fbacc17)
@milan-zededa milan-zededa self-assigned this Sep 28, 2023
@milan-zededa milan-zededa changed the title [10.4 stable] Backport recent bug fixes for zedrouter [10.4 stable] Backport recent zedrouter bug fixes Sep 28, 2023
Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@milan-zededa milan-zededa merged commit 2fd3c2f into lf-edge:10.4 Oct 2, 2023
11 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants