unset rather than reset mach header for non-TEB packets received by an
ipgre device.  This allows skb_transport_header_was_set to be subsequently
used to differentiate TEB and non-TEB packets recieved on an ipgre device.

Signed-off-by: Simon Horman <simon.hor...@netronome.com>
---
v11
* New patch
---
 net/ipv4/ip_gre.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 5b1481be0282..330d58e9c523 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -283,6 +283,8 @@ static int __ipgre_rcv(struct sk_buff *skb, const struct 
tnl_ptk_info *tpi,
 
                if (tunnel->dev->type != ARPHRD_NONE)
                        skb_pop_mac_header(skb);
+               else if (tpi->proto != htons(ETH_P_TEB))
+                       skb_unset_mac_header(skb);
                else
                        skb_reset_mac_header(skb);
                if (tunnel->collect_md) {
-- 
2.7.0.rc3.207.g0ac5344

Reply via email to