vxlan: fix endian of the configured port
authorFelix Fietkau <nbd@nbd.name>
Tue, 28 Jun 2022 12:06:30 +0000 (14:06 +0200)
committerFelix Fietkau <nbd@nbd.name>
Tue, 28 Jun 2022 12:06:35 +0000 (14:06 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
vxlan.c

diff --git a/vxlan.c b/vxlan.c
index 34bb869ae110516e3ac755ae9104ffd728e5c75f..b15d4c316da650a14debf7f9850bb50bc5455251 100644 (file)
--- a/vxlan.c
+++ b/vxlan.c
@@ -223,7 +223,7 @@ vxlan_tunnel_init(struct vxlan_tunnel *vt)
        nla_put_u32(msg, IFLA_VXLAN_ID, vxlan_tunnel_id(vt));
        nla_put(msg, IFLA_VXLAN_LOCAL6, sizeof(struct in6_addr), &local->local_addr);
        nla_put(msg, IFLA_VXLAN_GROUP6, sizeof(struct in6_addr), &group_addr);
-       nla_put_u16(msg, IFLA_VXLAN_PORT, vt->port);
+       nla_put_u16(msg, IFLA_VXLAN_PORT, htons(vt->port));
        nla_put_u8(msg, IFLA_VXLAN_LEARNING, 1);
        nla_put_u32(msg, IFLA_VXLAN_LINK, vt->net->ifindex);
        nla_nest_end(msg, data);