modules/network: do not use IPv6 link-local

Probably you don't want to see your IPv6 link-local address but rather a
global one.
This commit is contained in:
Oleg Hahm 2023-03-03 00:45:47 +01:00
parent d1776714ed
commit 8ccd79ad08
2 changed files with 4 additions and 1 deletions

View file

@ -28,8 +28,10 @@
* battery/network/script: `poll-interval` unit changed from seconds to
milliseconds ([#244][244]).
* all modules: minimum poll interval changed from 500ms to 250ms.
* network: do not use IPv6 link-local ([#281][281])
[244]: https://codeberg.org/dnkl/yambar/issues/244
[281]: https://codeberg.org/dnkl/yambar/pulls/281
### Deprecated

View file

@ -150,6 +150,7 @@ content(struct module *mod)
if (it->item.family == AF_INET)
inet_ntop(AF_INET, &it->item.addr.ipv4, ipv4_str, sizeof(ipv4_str));
else if (it->item.family == AF_INET6)
if(!IN6_IS_ADDR_LINKLOCAL(&it->item.addr.ipv6))
inet_ntop(AF_INET6, &it->item.addr.ipv6, ipv6_str, sizeof(ipv6_str));
}