[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOrHB_DrFXg=nQAdscOgX8nbUoOC4fMsWiN6R4n907zB5rtD=g@mail.gmail.com>
Date: Fri, 22 Apr 2016 14:07:01 -0700
From: pravin shelar <pshelar@....org>
To: Jiri Benc <jbenc@...hat.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Pravin B Shelar <pshelar@...ira.com>,
Thomas Graf <tgraf@...g.ch>,
Simon Horman <simon.horman@...ronome.com>
Subject: Re: [PATCH net 3/3] gre: receive also TEB packets for lwtunnels
On Fri, Apr 22, 2016 at 10:44 AM, Jiri Benc <jbenc@...hat.com> wrote:
> For ipgre interfaces in collect metadata mode, receive also traffic with
> encapsulated Ethernet headers. The lwtunnel users are supposed to sort this
> out correctly. This allows to have mixed Ethernet + L3-only traffic on the
> same lwtunnel interface.
>
How user is suppose to sort out the type of packet? whether it is L2 or L3.
> To keep backwards compatibility and prevent any surprises, gretap interfaces
> have priority in receiving packets with Ethernet headers.
>
> Signed-off-by: Jiri Benc <jbenc@...hat.com>
> ---
> include/net/ip_tunnels.h | 1 +
> net/ipv4/ip_gre.c | 34 +++++++++++++++++++++++++---------
> 2 files changed, 26 insertions(+), 9 deletions(-)
>
...
> +
> +static int ipgre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi)
> +{
> + struct net *net = dev_net(skb->dev);
> + struct ip_tunnel_net *itn;
> + int res;
> +
> + if (tpi->proto == htons(ETH_P_TEB))
> + itn = net_generic(net, gre_tap_net_id);
> + else
> + itn = net_generic(net, ipgre_net_id);
> +
> + res = __ipgre_rcv(skb, tpi, itn);
> + if (res == PACKET_NEXT && tpi->proto == htons(ETH_P_TEB)) {
> + /* ipgre tunnels in collect metadata mode should receive
> + * also ETH_P_TEB traffic
> + */
> + itn = net_generic(net, ipgre_net_id);
> + res = __ipgre_rcv(skb, tpi, int);
Is it fine to receive L2 packet over L3 device?
At least ip_tunnel_rcv() is not ready to handle such packet.
Powered by blists - more mailing lists