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

[fix] Updated the way default interfaces are chosen in netlink.rs #2151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vats004
Copy link
Contributor

@vats004 vats004 commented Mar 23, 2025

This pr changes the way the default route and corresponding default interface are chosen

possible problem in issue 2117

  1. default route is set by looking for any attrtibure that indicates the route being default route(by looking for Rta::Gateway)
  2. and simply took the first matching route’s interface index and the corresponding interface as default

What this fix does :

  1. Now, every default route(routes where rtm_dst_len == 0) is looked at
  2. and its interface index and a “metric” value is looked at
  3. whichever default route has the smallest metric, the interfave at its interface index is taken as the default interface

This should ensure that if multiple interfaces have “default routes,” the one with the lowest metric is chosen

@vats004 vats004 changed the title [fix] Fixed [issue 2117](https://github.com/greshake/i3status-rust/issues/2117) [fix] Updated the way default interfaces are chosen in netlink.rs Mar 23, 2025
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.

1 participant