diff mbox

[ovs-dev,net-next,v11,2/6] gre: unset mac header for non-TEB packets received by ipgre device

Message ID 1467827996-32547-3-git-send-email-simon.horman@netronome.com
State Not Applicable
Headers show

Commit Message

Simon Horman July 6, 2016, 5:59 p.m. UTC
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.horman@netronome.com>
---
v11
* New patch
---
 net/ipv4/ip_gre.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Pravin Shelar July 7, 2016, 8:51 p.m. UTC | #1
On Wed, Jul 6, 2016 at 10:59 AM, Simon Horman
<simon.horman@netronome.com> wrote:
> 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.horman@netronome.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
diff mbox

Patch

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) {