Skip to content

Commit

Permalink
netlink: specs: mptcp: fix port endianness
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/2086138

[ Upstream commit 09a45a5 ]

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: bc8aeb2 ("Documentation: netlink: add a YAML spec for mptcp")
Signed-off-by: Asbjørn Sloth Tønnesen <[email protected]>
Reviewed-by: Davide Caratti <[email protected]>
Reviewed-by: Matthieu Baerts (NGI0) <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Koichiro Den <[email protected]>
Signed-off-by: Roxana Nicolescu <[email protected]>
  • Loading branch information
Asbjørn Sloth Tønnesen authored and mehmetb0 committed Nov 9, 2024
1 parent a78297c commit 1ade5d2
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion Documentation/netlink/specs/mptcp_pm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ attribute-sets:
-
name: port
type: u16
byte-order: big-endian
-
name: flags
type: u32
Expand Down

0 comments on commit 1ade5d2

Please sign in to comment.