summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2012-12-24 16:51:03 +0000
committerDavid S. Miller <davem@davemloft.net>2012-12-26 15:19:56 -0800
commit861aa6d56de8147249c8a04a4e87fb7c3600cca1 (patch)
tree61554559d5bdb5a76b03f821b36d1f33fdf1fc22 /net
parenta49675988c127b5b5876c252e5db2ee0410a10c2 (diff)
downloadlwn-861aa6d56de8147249c8a04a4e87fb7c3600cca1.tar.gz
lwn-861aa6d56de8147249c8a04a4e87fb7c3600cca1.zip
ipv4/ip_gre: set transport header correctly to gre header
ipgre_tunnel_xmit() incorrectly sets transport header to inner payload instead of GRE header. It seems copy-and-pasted from ipip.c. So 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>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/ip_gre.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 58cb627560dd..303012adf9e6 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -912,9 +912,9 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
/* Warning : tiph value might point to freed memory */
}
- skb_reset_transport_header(skb);
skb_push(skb, gre_hlen);
skb_reset_network_header(skb);
+ skb_set_transport_header(skb, sizeof(*iph));
memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED |
IPSKB_REROUTED);