From: Guillaume Nault <gnault@redhat.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: David Miller <davem@davemloft.net>,
netdev@vger.kernel.org,
Martin Varghese <martin.varghese@nokia.com>,
Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH net] bareudp: forbid mixing IP and MPLS in multiproto mode
Date: Sat, 25 Jul 2020 13:05:35 +0200 [thread overview]
Message-ID: <20200725110535.GA4152@pc-2.home> (raw)
In-Reply-To: <20200724162134.7b0c8aaa@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
On Fri, Jul 24, 2020 at 04:21:34PM -0700, Jakub Kicinski wrote:
> On Fri, 24 Jul 2020 23:03:26 +0200 Guillaume Nault wrote:
> > In multiproto mode, bareudp_xmit() accepts sending multicast MPLS and
> > IPv6 packets regardless of the bareudp ethertype. In practice, this
> > let an IP tunnel send multicast MPLS packets, or an MPLS tunnel send
> > IPv6 packets.
> >
> > We need to restrict the test further, so that the multiproto mode only
> > enables
> > * IPv6 for IPv4 tunnels,
> > * or multicast MPLS for unicast MPLS tunnels.
> >
> > To improve clarity, the protocol validation is moved to its own
> > function, where each logical test has its own condition.
> >
> > Fixes: 4b5f67232d95 ("net: Special handling for IP & MPLS.")
> > Signed-off-by: Guillaume Nault <gnault@redhat.com>
>
> Hi! this adds 10 sparse warnings:
>
> drivers/net/bareudp.c:419:22: warning: cast to restricted __be16
> drivers/net/bareudp.c:419:22: warning: cast to restricted __be16
> drivers/net/bareudp.c:419:22: warning: cast to restricted __be16
> drivers/net/bareudp.c:419:22: warning: cast to restricted __be16
> drivers/net/bareudp.c:419:13: warning: restricted __be16 degrades to integer
> drivers/net/bareudp.c:423:22: warning: cast to restricted __be16
> drivers/net/bareudp.c:423:22: warning: cast to restricted __be16
> drivers/net/bareudp.c:423:22: warning: cast to restricted __be16
> drivers/net/bareudp.c:423:22: warning: cast to restricted __be16
>
> I think this:
>
> proto == ntohs(ETH_P_MPLS_MC))
>
> has to say htons() not ntohs(). For v6 as well.
>
Ouch, sorry. I'll respin.
prev parent reply other threads:[~2020-07-25 11:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-24 21:03 [PATCH net] bareudp: forbid mixing IP and MPLS in multiproto mode Guillaume Nault
2020-07-24 23:21 ` Jakub Kicinski
2020-07-25 11:05 ` Guillaume Nault [this message]
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=20200725110535.GA4152@pc-2.home \
--to=gnault@redhat.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=martin.varghese@nokia.com \
--cc=netdev@vger.kernel.org \
--cc=willemb@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).