]> git.dujemihanovic.xyz Git - linux.git/commitdiff
netlink: specs: mptcp: fix port endianness
authorAsbjørn Sloth Tønnesen <ast@fiberby.net>
Wed, 11 Sep 2024 09:10:02 +0000 (09:10 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 Sep 2024 03:42:47 +0000 (20:42 -0700)
The MPTCP port attribute is in host endianness, but was documented
as big-endian in the ynl specification.

Below are two examples from net/mptcp/pm_netlink.c showing that the
attribute is converted to/from host endianness for use with netlink.

Import from netlink:
  addr->port = htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT]))

Export to netlink:
  nla_put_u16(skb, MPTCP_PM_ADDR_ATTR_PORT, ntohs(addr->port))

Where addr->port is defined as __be16.

No functional change intended.

Fixes: bc8aeb2045e2 ("Documentation: netlink: add a YAML spec for mptcp")
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Reviewed-by: Davide Caratti <dcaratti@redhat.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20240911091003.1112179-1-ast@fiberby.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/netlink/specs/mptcp_pm.yaml

index af525ed2979234e90e90aed24005c79589c8dc35..30d8342cacc8704c42b84c9e03f96c906e81733e 100644 (file)
@@ -109,7 +109,6 @@ attribute-sets:
       -
         name: port
         type: u16
-        byte-order: big-endian
       -
         name: flags
         type: u32