From 624a47694cad4c87b2e807c32db656f3e9d679c5 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 28 Jan 2019 12:27:37 +0100 Subject: [PATCH] network/wireguard: use sd_netlink_message_append_sockaddr_in{,6}() --- src/network/netdev/wireguard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c index dd239f7..0c0b16d 100644 --- a/src/network/netdev/wireguard.c +++ b/src/network/netdev/wireguard.c @@ -123,9 +123,9 @@ static int wireguard_set_peer_one(NetDev *netdev, sd_netlink_message *message, c goto cancel; if (peer->endpoint.sa.sa_family == AF_INET) - r = sd_netlink_message_append_data(message, WGPEER_A_ENDPOINT, &peer->endpoint.in, sizeof(peer->endpoint.in)); + r = sd_netlink_message_append_sockaddr_in(message, WGPEER_A_ENDPOINT, &peer->endpoint.in); else if (peer->endpoint.sa.sa_family == AF_INET6) - r = sd_netlink_message_append_data(message, WGPEER_A_ENDPOINT, &peer->endpoint.in6, sizeof(peer->endpoint.in6)); + r = sd_netlink_message_append_sockaddr_in6(message, WGPEER_A_ENDPOINT, &peer->endpoint.in6); if (r < 0) goto cancel; } -- 2.7.4