]> git.ipfire.org Git - thirdparty/systemd.git/commit
networkd: report per-interface addresses as io.systemd.Network.Address 42315/head
authorMichael Vogt <michael@amutable.com>
Tue, 26 May 2026 13:57:03 +0000 (15:57 +0200)
committerMichael Vogt <michael@amutable.com>
Sat, 20 Jun 2026 08:37:47 +0000 (10:37 +0200)
commit42f913abf3689c2cb619e3924d4e4f5972405cc5
tree7350c26a09502acf438912a0aae27beb586b4561
parent0b0db27050595251b40b4e7cf56593a275eaf3c2
networkd: report per-interface addresses as io.systemd.Network.Address

The networkd metrics interface already reports a lot of interesting
metrics. With this commit it also report the network addresses too.

Each ready address is emitted as one record per (interface, address)
pair:
- object: ifname
- value:  address in CIDR notation
- fields: { family: "ipv4"|"ipv6", scope: "global"|"link"|"host"|... }

The loopback addresses are not reported as its just noise.

Example output:
```
root@localhost:~# varlinkctl --more --json=short call /run/systemd/report/io.systemd.Network io.systemd.Metrics.List '{}'
{"name":"io.systemd.Network.Address","object":"enp0s1","value":"fe80::5054:ff:fe12:3456/64","fields":{"family":"ipv6","scope":"link"}}
{"name":"io.systemd.Network.Address","object":"enp0s1","value":"fec0::5054:ff:fe12:3456/64","fields":{"family":"ipv6","scope":"site"}}
{"name":"io.systemd.Network.Address","object":"enp0s1","value":"10.0.2.15/24","fields":{"family":"ipv4","scope":"global"}}
```
src/network/networkd-varlink-metrics.c
test/units/TEST-74-AUX-UTILS.report.sh