networkd: fix attribute length for wireguard (#10380)
This is actually a u16, not a u32, so the kernel complains:
kernel: netlink: 'systemd-network': attribute type 5 has an invalid length
This is due to:
if (nla_attr_len[pt->type] && attrlen != nla_attr_len[pt->type]) {
pr_warn_ratelimited("netlink: '%s': attribute type %d has an invalid length.\n",
current->comm, type);
}
Presumably this has been working fine in functionality on little-endian
systems, but nobody bothered to try on big-endian systems.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
committed by
Yu Watanabe
parent
b75f0c69b3
commit
7d0b26a027
@@ -107,7 +107,7 @@ static int set_wireguard_interface(NetDev *netdev) {
|
||||
if (r < 0)
|
||||
break;
|
||||
|
||||
r = sd_netlink_message_append_u32(message, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, peer->persistent_keepalive_interval);
|
||||
r = sd_netlink_message_append_u16(message, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, peer->persistent_keepalive_interval);
|
||||
if (r < 0)
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user