[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200724162134.7b0c8aaa@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Fri, 24 Jul 2020 16:21:34 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Guillaume Nault <gnault@...hat.com>
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, 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.
Powered by blists - more mailing lists