From: Davide Caratti <dcaratti@redhat.com>
To: "Asbjørn Sloth Tønnesen" <ast@fiberby.net>
Cc: Matthieu Baerts <matttbe@kernel.org>,
Mat Martineau <martineau@kernel.org>,
Geliang Tang <geliang@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Donald Hunter <donald.hunter@gmail.com>,
netdev@vger.kernel.org, mptcp@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] netlink: specs: mptcp: fix port endianness
Date: Wed, 11 Sep 2024 14:42:00 +0200 [thread overview]
Message-ID: <ZuGQGPDUS6o2B5ai@dcaratti.users.ipa.redhat.com> (raw)
In-Reply-To: <20240911091003.1112179-1-ast@fiberby.net>
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@fiberby.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@redhat.com>
next prev parent reply other threads:[~2024-09-11 12:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 9:10 [PATCH net] netlink: specs: mptcp: fix port endianness Asbjørn Sloth Tønnesen
2024-09-11 10:04 ` MPTCP CI
2024-09-11 12:42 ` Davide Caratti [this message]
2024-09-11 15:07 ` Matthieu Baerts
2024-09-12 3:50 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZuGQGPDUS6o2B5ai@dcaratti.users.ipa.redhat.com \
--to=dcaratti@redhat.com \
--cc=ast@fiberby.net \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@google.com \
--cc=geliang@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martineau@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.