aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2012-12-24 11:51:04 -0500
committerDavid S. Miller <davem@davemloft.net>2012-12-26 18:19:56 -0500
commitae782bb16c35ce27512beeda9be6024c88f85b08 (patch)
tree10d52422a5e8b0cf7380cf5807eb7036855c3989
parent861aa6d56de8147249c8a04a4e87fb7c3600cca1 (diff)
ipv6/ip6_gre: set transport header correctly
ip6gre_xmit2() incorrectly sets transport header to inner payload instead of GRE header. It seems copy-and-pasted from ipip.c. Set transport header to gre header. (In ipip case the transport header is the inner ip header, so that's correct.) Found by inspection. In practice the incorrect transport header doesn't matter because the skb usually is sent to another net_device or socket, so the transport header isn't referenced. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/ip6_gre.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 867466c96aa..c727e471275 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -758,8 +758,6 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
758 skb_dst_set_noref(skb, dst); 758 skb_dst_set_noref(skb, dst);
759 } 759 }
760 760
761 skb->transport_header = skb->network_header;
762
763 proto = NEXTHDR_GRE; 761 proto = NEXTHDR_GRE;
764 if (encap_limit >= 0) { 762 if (encap_limit >= 0) {
765 init_tel_txopt(&opt, encap_limit); 763 init_tel_txopt(&opt, encap_limit);
@@ -768,6 +766,7 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
768 766
769 skb_push(skb, gre_hlen); 767 skb_push(skb, gre_hlen);
770 skb_reset_network_header(skb); 768 skb_reset_network_header(skb);
769 skb_set_transport_header(skb, sizeof(*ipv6h));
771 770
772 /* 771 /*
773 * Push down and install the IP header. 772 * Push down and install the IP header.