-
Notifications
You must be signed in to change notification settings - Fork 87
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
Fix priority changing on Bookworm #3093
base: master
Are you sure you want to change the base?
Conversation
6f892b9
to
0a9cf5c
Compare
b6f4352
to
2840d3f
Compare
2840d3f
to
7709020
Compare
7709020
to
90bf365
Compare
Reviewer's Guide by SourceryThis pull request refactors how network interface priorities are managed on Bookworm by removing legacy implementations and standardizing on using the settings file as the source of truth. The changes include the introduction of a new method for updating default routes with retries, removal of redundant and legacy priority functions, updates to the network manager’s configuration handling, and corresponding adjustments on the UI side to accommodate the new priority-setting logic. Sequence diagram for setting network interface prioritysequenceDiagram
actor User
participant UI as NetworkInterfacePriorityMenu (UI)
participant API as Cable Guy Manager (API)
participant Handler as NetworkHandler (BookwormHandler / DHCPCD)
participant OS as Operating System (IPRoute)
User->>UI: Clicks "Set Highest Interface" button
UI->>API: POST /set_interfaces_priority (with new priorities)
API->>API: Validate interface names and priorities
API->>Handler: set_interfaces_priority(interfaces)
Handler->>Handler: set_interfaces_priority_using_ipr(interfaces)
loop For each interface
Handler->>OS: ipr.link_lookup(ifname) and ipr.get_routes(...)
loop For each default route
Handler->>Handler: _update_route(interface_name, interface_index, route, priority)
alt Route requires update
Handler->>OS: ipr.route(del, ...)
loop Retry up to 3 times
Handler->>OS: ipr.route(add, priority + attempt, ...)
Note over OS: Returns success or error
end
else No update needed
Note over Handler: Skip route
end
end
end
Handler-->>API: Returns after processing routes
API->>API: Save updated settings (using settings file as source of truth)
API->>UI: Return success response
UI->>User: Notify updated interface priorities
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Williangalvani - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider explicitly comparing the route destination to '0.0.0.0/0' in _update_route for clarity rather than relying on a None check.
- Avoid clearing the entire interfaces array in setHighestInterface; an optimistic update might reduce UI flicker.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
core/frontend/src/components/app/NetworkInterfacePriorityMenu.vue
Outdated
Show resolved
Hide resolved
Co-authored-by: João Mário Lago <58235456+JoaoMario109@users.noreply.github.com>
to test the routing, use
watch ip route
, then change it in the UI.this is now also always using the settings file as a source of truth, instead of randomly accepting the current state and saving it to the settings file.
fix #3086
tested on bookworm and bullseye
Summary by Sourcery
Fix interface priority issues on Debian Bookworm.
Bug Fixes:
Enhancements:
Tests: