You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.
During serialization, the VXLAN port is serialized using the host endianess, which is incorrect as netlink uses network endianess, which is big endian. This breaks on little-endian architectures, such as x86.
will result in a vxlan interface with a dstport of 46354, which is 4789 with the two bytes swapped:
$ ip -d l show dev vxlan10
9: vxlan10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 7e:e7:d4:c7:ec:2c brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 68 maxmtu 65535
vxlan id 10 local 172.16.0.1 srcport 0 0 dstport 46354 nolearning ttl auto ageing 300 udpcsum noudp6zerocsumtx noudp6zerocsumrx
Interesting this is, parsing is done correctly by using u16::from_be_bytes().
Doing .port(u16::from_be(4789)) makes the link come with the proper port.
The text was updated successfully, but these errors were encountered:
During serialization, the VXLAN port is serialized using the host endianess, which is incorrect as netlink uses network endianess, which is big endian. This breaks on little-endian architectures, such as x86.
Example on x86 (handle setup omitted):
will result in a vxlan interface with a dstport of 46354, which is 4789 with the two bytes swapped:
Interesting this is, parsing is done correctly by using
u16::from_be_bytes()
.Doing
.port(u16::from_be(4789))
makes the link come with the proper port.The text was updated successfully, but these errors were encountered: