Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

[BUG `waybar-network`] Enforcing `interface` causes `{gwaddr}` to be empty

Open subnut opened this issue 2 years ago • 1 comments

Case 1

config

"network#wifi": {
  "interface": "wl*"
  "format-wifi": "{gwaddr}",
}

result

module is empty

debug log (network-relevant entries only)

[2022-05-21 13:27:25.066] [debug] network: selecting new interface wlp3s0/3
[2022-05-21 13:27:25.066] [debug] network: wlp3s0, new addr aaa.bbb.ccc.ddd/24

Case 2

config

"network#wifi": {
  "format-wifi": "{gwaddr}",
}

result

module contains gateway address

debug log (network-relevant entries only)

[2022-05-21 13:28:08.345] [debug] network: new default route via aaa.bbb.ccc.xxx on if3 metric 3003
[2022-05-21 13:27:25.066] [debug] network: wlp3s0, new addr aaa.bbb.ccc.ddd/24

NOTE

In the logs, I have replaced the actual IP address with aaa.bbb.ccc.ddd and aaa.bbb.ccc.xxx

subnut avatar May 21 '22 07:05 subnut

Diagnosis

  • If interface is set in the config, then config_["interface"].isString() is true.
  • When config_["interface"].isString() is true, the module never sets want_route_dump_ = true;
  • so askForStateDump() never asks for a route dump
  • so handleEvents() never receives a RTM_NEWROUTE message
  • and so it never sets net->gwaddr_
  • and therefore, gwaddr_ remains unset.

subnut avatar May 23 '22 09:05 subnut

Should be better with a4d27ea

Alexays avatar Oct 28 '22 12:10 Alexays

Nope, still not fixed.

subnut avatar Jan 28 '23 06:01 subnut

Same for me.

felixauringer avatar Jan 28 '23 07:01 felixauringer

Still happening with waybar 0.9.24.

Reylak avatar Feb 16 '24 08:02 Reylak