[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200725110535.GA4152@pc-2.home>
Date: Sat, 25 Jul 2020 13:05:35 +0200
From: Guillaume Nault <gnault@...hat.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
Martin Varghese <martin.varghese@...ia.com>,
Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net] bareudp: forbid mixing IP and MPLS in multiproto mode
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@...hat.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.
Powered by blists - more mailing lists