[ovs-dev] [PATCH 01/14] tunneling: Clear OVS_CB after call to update_header().

Jesse Gross jesse at nicira.com
Thu Dec 2 20:36:50 UTC 2010


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 at nicira.com>
---
 datapath/tunnel.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/datapath/tunnel.c b/datapath/tunnel.c
index cf74212..4a60fa7 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));
 
-- 
1.7.1





More information about the dev mailing list