aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/ipip.h2
-rw-r--r--net/ipv4/ip_gre.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/include/net/ipip.h b/include/net/ipip.h
index a85bda64b852..fdf9bd743705 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -37,7 +37,7 @@ struct ip_tunnel_prl_entry
37 37
38#define IPTUNNEL_XMIT() do { \ 38#define IPTUNNEL_XMIT() do { \
39 int err; \ 39 int err; \
40 int pkt_len = skb->len; \ 40 int pkt_len = skb->len - skb_transport_offset(skb); \
41 \ 41 \
42 skb->ip_summed = CHECKSUM_NONE; \ 42 skb->ip_summed = CHECKSUM_NONE; \
43 ip_select_ident(iph, &rt->u.dst, NULL); \ 43 ip_select_ident(iph, &rt->u.dst, NULL); \
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 44ed9487fa15..0d5e35b0ed54 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -477,6 +477,7 @@ static int ipgre_rcv(struct sk_buff *skb)
477 struct ip_tunnel *tunnel; 477 struct ip_tunnel *tunnel;
478 int offset = 4; 478 int offset = 4;
479 __be16 gre_proto; 479 __be16 gre_proto;
480 unsigned int len;
480 481
481 if (!pskb_may_pull(skb, 16)) 482 if (!pskb_may_pull(skb, 16))
482 goto drop_nolock; 483 goto drop_nolock;
@@ -567,6 +568,8 @@ static int ipgre_rcv(struct sk_buff *skb)
567 tunnel->i_seqno = seqno + 1; 568 tunnel->i_seqno = seqno + 1;
568 } 569 }
569 570
571 len = skb->len;
572
570 /* Warning: All skb pointers will be invalidated! */ 573 /* Warning: All skb pointers will be invalidated! */
571 if (tunnel->dev->type == ARPHRD_ETHER) { 574 if (tunnel->dev->type == ARPHRD_ETHER) {
572 if (!pskb_may_pull(skb, ETH_HLEN)) { 575 if (!pskb_may_pull(skb, ETH_HLEN)) {
@@ -581,7 +584,7 @@ static int ipgre_rcv(struct sk_buff *skb)
581 } 584 }
582 585
583 stats->rx_packets++; 586 stats->rx_packets++;
584 stats->rx_bytes += skb->len; 587 stats->rx_bytes += len;
585 skb->dev = tunnel->dev; 588 skb->dev = tunnel->dev;
586 dst_release(skb->dst); 589 dst_release(skb->dst);
587 skb->dst = NULL; 590 skb->dst = NULL;
@@ -770,7 +773,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
770 old_iph = ip_hdr(skb); 773 old_iph = ip_hdr(skb);
771 } 774 }
772 775
773 skb->transport_header = skb->network_header; 776 skb_reset_transport_header(skb);
774 skb_push(skb, gre_hlen); 777 skb_push(skb, gre_hlen);
775 skb_reset_network_header(skb); 778 skb_reset_network_header(skb);
776 memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); 779 memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));