aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/ip_gre.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index b8bada00d516..406512934507 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -735,7 +735,7 @@ drop:
735 return 0; 735 return 0;
736} 736}
737 737
738static struct sk_buff *handle_offloads(struct sk_buff *skb) 738static struct sk_buff *handle_offloads(struct ip_tunnel *tunnel, struct sk_buff *skb)
739{ 739{
740 int err; 740 int err;
741 741
@@ -745,8 +745,12 @@ static struct sk_buff *handle_offloads(struct sk_buff *skb)
745 goto error; 745 goto error;
746 skb_shinfo(skb)->gso_type |= SKB_GSO_GRE; 746 skb_shinfo(skb)->gso_type |= SKB_GSO_GRE;
747 return skb; 747 return skb;
748 } 748 } else if (skb->ip_summed == CHECKSUM_PARTIAL &&
749 if (skb->ip_summed != CHECKSUM_PARTIAL) 749 tunnel->parms.o_flags&GRE_CSUM) {
750 err = skb_checksum_help(skb);
751 if (unlikely(err))
752 goto error;
753 } else if (skb->ip_summed != CHECKSUM_PARTIAL)
750 skb->ip_summed = CHECKSUM_NONE; 754 skb->ip_summed = CHECKSUM_NONE;
751 755
752 return skb; 756 return skb;
@@ -776,7 +780,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
776 int err; 780 int err;
777 int pkt_len; 781 int pkt_len;
778 782
779 skb = handle_offloads(skb); 783 skb = handle_offloads(tunnel, skb);
780 if (IS_ERR(skb)) { 784 if (IS_ERR(skb)) {
781 dev->stats.tx_dropped++; 785 dev->stats.tx_dropped++;
782 return NETDEV_TX_OK; 786 return NETDEV_TX_OK;