From: Jesse Gross Date: Wed, 15 Dec 2010 23:38:06 +0000 (-0800) Subject: tunneling: Refresh IP header pointer after update_header(). X-Git-Tag: v1.1.0~606 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=3d8981230bb0c9c11db70f1444e4940ac02d3888;p=sliver-openvswitch.git tunneling: Refresh IP header pointer after update_header(). We were assuming that the call to update_header() to finalize tunnel headers wouldn't cause the skb linear data area to be reallocated. So far this hasn't been a problem but it's not, generally speaking, a good assumption to make. Therefore, refetch the pointer to the IP header instead of carrying it across the call. Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- diff --git a/datapath/tunnel.c b/datapath/tunnel.c index bf66f4f09..eac3fa3d8 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -1284,6 +1284,7 @@ int tnl_send(struct vport *vport, struct sk_buff *skb) struct vport *cache_vport = internal_dev_get_vport(rt_dst(rt).dev); skb->protocol = htons(ETH_P_IP); + iph = ip_hdr(skb); iph->tot_len = htons(skb->len - skb_network_offset(skb)); ip_send_check(iph);