Skip to content

Show the network interface with highest priority (aka lower metric) #2585

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

Merged
merged 1 commit into from
Oct 21, 2023
Merged

Show the network interface with highest priority (aka lower metric) #2585

merged 1 commit into from
Oct 21, 2023

Conversation

davxy
Copy link
Contributor

@davxy davxy commented Oct 20, 2023

On new interface discovery a new index is (may be) assigned to the temp_idx.

The new interface should be assigned to net if is the first one (net->ifid_ == -1) or if has higher priority (priority < net->route_priority... lower is higher according to metric).

This PR removes the additional condition net->ifid_ != temp_idx which is always be true and incorrectly ends up showing the last found route instead of the one with higher priority

Closes #2167

@davxy davxy changed the title Different interfaces have different index Show the network interface with highest priority (aka lower metric) Oct 20, 2023
@Alexays
Copy link
Owner

Alexays commented Oct 20, 2023

We should check why we introduced that condition with this commit.
a4d27ea

@davxy
Copy link
Contributor Author

davxy commented Oct 21, 2023

If I'm not wrong like you are the author of that modification right 😃.

However at the moment is broken as it doesn't show the interface which is effectively used

@Alexays
Copy link
Owner

Alexays commented Oct 21, 2023

Yep, but i don't remember why :D
Thanks, let's merge it!

@Alexays Alexays merged commit dbb887b into Alexays:master Oct 21, 2023
@khaled4vokalz
Copy link

khaled4vokalz commented May 23, 2024

did we release this fix? I still don't see my LAN to get the priority, instead it's always WIFI...

EDIT:
It seems like ubuntu still has 0.9.22 through APT...

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.

request for waybar-network interface priority and exclusion
3 participants