Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

Network module believes interface has no IP after IPv6 temporary address gets rotated

Open omgold opened this issue 8 months ago • 0 comments

I'm using both IPv4 and IPv6. I find that the Network module says (no IP) and doesn't show the normal network info, like bandwidth anymore after the network stack switches the temporary IPv6 address (created because net.ipv6.conf.*.use_tempaddr = 2).

I believe the reason is a logic error in waybar::modules::Network::handleEvents().

Here the net is assumed to not have an address anymore after an address is deleted:

            if (!is_del_event) {
                ...
            } else {
              net->ipaddr_.clear();
              net->cidr_ = 0;
              net->netmask_.clear();
              spdlog::debug("network: {} addr deleted {}/{}", net->ifname_,
                            inet_ntop(ifa->ifa_family, RTA_DATA(ifa_rta), ipaddr, sizeof(ipaddr)),
                            ifa->ifa_prefixlen);
            }

As the rotation of the IPv6 seems to first add the new address, then remove the old one, the behavior described above results.

I'm using Waybar 0.12.0

omgold avatar Jun 05 '25 13:06 omgold