tunneling: Refresh IP header pointer after update_header().
authorJesse Gross <jesse@nicira.com>
Wed, 15 Dec 2010 23:38:06 +0000 (15:38 -0800)
committerJesse Gross <jesse@nicira.com>
Thu, 16 Dec 2010 17:42:08 +0000 (09:42 -0800)
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 <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/tunnel.c

index bf66f4f0932abc14df598aad53fcf6659ae2bb3e..eac3fa3d86f15bbd21f475ef45846425d05532fa 100644 (file)
@@ -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);