summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2023-08-14 16:07:46 +0200
committerDavid Tardon <dtardon@redhat.com>2023-08-17 09:48:17 +0200
commit9aad490e53888c39434f668df833e0e179f144b0 (patch)
treec12125c7131abbe30b62bcec5a2fb15c9050ab47 /src/network
parentlist: add LIST_CLEAR() helper that empties the list (diff)
downloadsystemd-9aad490e53888c39434f668df833e0e179f144b0.tar.xz
systemd-9aad490e53888c39434f668df833e0e179f144b0.zip
tree-wide: use LIST_CLEAR()
Diffstat (limited to 'src/network')
-rw-r--r--src/network/netdev/wireguard.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c
index ffc6452bbf..0e992f9ad1 100644
--- a/src/network/netdev/wireguard.c
+++ b/src/network/netdev/wireguard.c
@@ -35,14 +35,9 @@ static void wireguard_resolve_endpoints(NetDev *netdev);
static int peer_resolve_endpoint(WireguardPeer *peer);
static void wireguard_peer_clear_ipmasks(WireguardPeer *peer) {
- WireguardIPmask *mask;
-
assert(peer);
- while ((mask = peer->ipmasks)) {
- LIST_REMOVE(ipmasks, peer->ipmasks, mask);
- free(mask);
- }
+ LIST_CLEAR(ipmasks, peer->ipmasks, free);
}
static WireguardPeer* wireguard_peer_free(WireguardPeer *peer) {