tunneling: Clear IP control block in one memset.
authorJesse Gross <jesse@nicira.com>
Thu, 2 Dec 2010 21:07:36 +0000 (13:07 -0800)
committerJesse Gross <jesse@nicira.com>
Fri, 3 Dec 2010 01:10:14 +0000 (17:10 -0800)
We currently clear both the members of the IPCB individually before
entering the IP stack.  It's simpler and more robust to just clear
the entire structure.

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

index 4a60fa78678c044c58c38654693e3371a17d4f3f..f0ae98d0500f9efca1f849d9a479bbf84ebe918e 100644 (file)
@@ -1099,9 +1099,7 @@ static int send_frags(struct sk_buff *skb,
                int frag_len = skb->len - mutable->tunnel_hlen;
 
                skb->next = NULL;
-
-               memset(&IPCB(skb)->opt, 0, sizeof(IPCB(skb)->opt));
-               IPCB(skb)->flags = 0;
+               memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
 
                err = ip_local_out(skb);
                if (likely(net_xmit_eval(err) == 0))