From 7da5c9390e3b6c3ad5e0443e171e570fc16ff978 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Fri, 19 Nov 2010 13:10:14 -0800 Subject: [PATCH] tunneling: Clear OVS_CB after call to update_header(). 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 Acked-by: Ben Pfaff --- datapath/tunnel.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/datapath/tunnel.c b/datapath/tunnel.c index cf742125e..4a60fa786 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -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)); -- 2.43.0