tunneling: Clear OVS_CB after call to update_header().
authorJesse Gross <jesse@nicira.com>
Fri, 19 Nov 2010 21:10:14 +0000 (13:10 -0800)
committerJesse Gross <jesse@nicira.com>
Fri, 3 Dec 2010 01:10:14 +0000 (17:10 -0800)
If a packet is traversing the IP stack we need to clear some pieces
of the skb CB beforehand.  We currently do this before the call to
update_header() but header generation may need some members of the
CB, such as the key.  Therefore, zero out the CB only after the
header is complete.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/tunnel.c

index cf742125e3618e08ea995d4f9713d76e1a35da86..4a60fa78678c044c58c38654693e3371a17d4f3f 100644 (file)
@@ -1100,6 +1100,9 @@ static int send_frags(struct sk_buff *skb,
 
                skb->next = NULL;
 
+               memset(&IPCB(skb)->opt, 0, sizeof(IPCB(skb)->opt));
+               IPCB(skb)->flags = 0;
+
                err = ip_local_out(skb);
                if (likely(net_xmit_eval(err) == 0))
                        sent_len += frag_len;
@@ -1247,10 +1250,6 @@ int tnl_send(struct vport *vport, struct sk_buff *skb)
                                skb_dst_set(skb, unattached_dst);
                                unattached_dst = NULL;
                        }
-
-
-                       memset(&IPCB(skb)->opt, 0, sizeof(IPCB(skb)->opt));
-                       IPCB(skb)->flags = 0;
                }
                skb_set_transport_header(skb, skb_network_offset(skb) + sizeof(struct iphdr));