Skip to content

Commit 43a09fb

Browse files
committed
netlink-packet-route: VXLAN port attribute must be parsed as u16_be
Currently it is returning a wrong value. e.g: For a VXLAN with a dst_port "4789" the value that rust-netlink returns is "46354". Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
1 parent f0976df commit 43a09fb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rtnl/link/nlas/link_infos.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,9 @@ impl<'a, T: AsRef<[u8]> + ?Sized> Parseable<NlaBuffer<&'a T>> for InfoVxlan {
650650
let high = parse_u16(&payload[2..]).context(err)?;
651651
PortRange((low, high))
652652
}
653-
IFLA_VXLAN_PORT => Port(parse_u16(payload).context("invalid IFLA_VXLAN_PORT value")?),
653+
IFLA_VXLAN_PORT => {
654+
Port(parse_u16_be(payload).context("invalid IFLA_VXLAN_PORT value")?)
655+
}
654656
IFLA_VXLAN_UDP_CSUM => {
655657
UDPCsum(parse_u8(payload).context("invalid IFLA_VXLAN_UDP_CSUM value")?)
656658
}

0 commit comments

Comments
 (0)