aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2014-09-29 23:22:32 -0400
committerDavid S. Miller <davem@davemloft.net>2014-10-01 21:35:51 -0400
commit54bc9bac307861aea5abb747cb58bf0275f2175f (patch)
tree0e0deb57718c2ee62d83405a4b9b605181ee65a1 /net/ipv6
parent077c5a0948cc7b75032288bd37bd6641ef05da76 (diff)
gre: Set inner protocol in v4 and v6 GRE transmit
Call skb_set_inner_protocol to set inner Ethernet protocol to protocol being encapsulation by GRE before tunnel_xmit. This is needed for GSO if UDP encapsulation (fou) is being done. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/ip6_gre.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 5f19dfbc4c6a..9a0a1aafe727 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -616,6 +616,7 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
616 int err = -1; 616 int err = -1;
617 u8 proto; 617 u8 proto;
618 struct sk_buff *new_skb; 618 struct sk_buff *new_skb;
619 __be16 protocol;
619 620
620 if (dev->type == ARPHRD_ETHER) 621 if (dev->type == ARPHRD_ETHER)
621 IPCB(skb)->flags = 0; 622 IPCB(skb)->flags = 0;
@@ -732,8 +733,9 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
732 ipv6h->daddr = fl6->daddr; 733 ipv6h->daddr = fl6->daddr;
733 734
734 ((__be16 *)(ipv6h + 1))[0] = tunnel->parms.o_flags; 735 ((__be16 *)(ipv6h + 1))[0] = tunnel->parms.o_flags;
735 ((__be16 *)(ipv6h + 1))[1] = (dev->type == ARPHRD_ETHER) ? 736 protocol = (dev->type == ARPHRD_ETHER) ?
736 htons(ETH_P_TEB) : skb->protocol; 737 htons(ETH_P_TEB) : skb->protocol;
738 ((__be16 *)(ipv6h + 1))[1] = protocol;
737 739
738 if (tunnel->parms.o_flags&(GRE_KEY|GRE_CSUM|GRE_SEQ)) { 740 if (tunnel->parms.o_flags&(GRE_KEY|GRE_CSUM|GRE_SEQ)) {
739 __be32 *ptr = (__be32 *)(((u8 *)ipv6h) + tunnel->hlen - 4); 741 __be32 *ptr = (__be32 *)(((u8 *)ipv6h) + tunnel->hlen - 4);
@@ -754,6 +756,8 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
754 } 756 }
755 } 757 }
756 758
759 skb_set_inner_protocol(skb, protocol);
760
757 ip6tunnel_xmit(skb, dev); 761 ip6tunnel_xmit(skb, dev);
758 if (ndst) 762 if (ndst)
759 ip6_tnl_dst_store(tunnel, ndst); 763 ip6_tnl_dst_store(tunnel, ndst);