[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZuGQGPDUS6o2B5ai@dcaratti.users.ipa.redhat.com>
Date: Wed, 11 Sep 2024 14:42:00 +0200
From: Davide Caratti <dcaratti@...hat.com>
To: Asbjørn Sloth Tønnesen <ast@...erby.net>
Cc: Matthieu Baerts <matttbe@...nel.org>,
Mat Martineau <martineau@...nel.org>,
Geliang Tang <geliang@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Donald Hunter <donald.hunter@...il.com>, netdev@...r.kernel.org,
mptcp@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] netlink: specs: mptcp: fix port endianness
hello Asbjørn,
On Wed, Sep 11, 2024 at 09:10:02AM +0000, Asbjørn Sloth Tønnesen wrote:
> 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@...erby.net>
not sure why we are doing addresses in network byte order
and ports in host byte order for endpoints. But it's like this since the
very beginning, so this host ordering in spec is correct.
Reviewed-by: Davide Caratti <dcaratti@...hat.com>
Powered by blists - more mailing lists