datapath: Memset executed packet's fields using memset.
authorJesse Gross <jesse@nicira.com>
Thu, 24 Feb 2011 04:04:31 +0000 (20:04 -0800)
committerJesse Gross <jesse@nicira.com>
Thu, 24 Feb 2011 04:40:26 +0000 (20:40 -0800)
Currently we explicitly zero out each of the fields in the OVS_CB for
executed packets.  However, it seems simpler and more robust to just
memset the whole thing to zero.

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

index dcff05f2986dbc23749c01063eb47ce3f10b120c..531afebca13c603c343885a45f844a0d519146ba 100644 (file)
@@ -710,13 +710,7 @@ static int odp_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
                goto exit;
 
        /* Initialize OVS_CB (it came from Netlink so might not be zeroed). */
-       OVS_CB(packet)->vport = NULL;
-       OVS_CB(packet)->flow = NULL;
-       /* execute_actions() will reset tun_id to 0 anyhow. */
-#ifdef NEED_CSUM_NORMALIZE
-       OVS_CB(packet)->ip_summed = OVS_CSUM_NONE;
-#endif
-       vlan_copy_skb_tci(packet);
+       memset(OVS_CB(packet), 0, sizeof(struct ovs_skb_cb));
 
        rcu_read_lock();
        dp = get_dp(odp_header->dp_ifindex);