From: Jesse Gross Date: Mon, 24 Jun 2013 19:21:29 +0000 (-0700) Subject: datapath: Do not clear key in ovs_match_init() X-Git-Tag: sliver-openvswitch-1.10.90-3~6^2~65 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=46d4c97ff75b647474f59cb141623a89a75388cd datapath: Do not clear key in ovs_match_init() When executing packets sent from userspace, the majority of the flow information is extracted from the packet itself and a small amount of metadata supplied by userspace is added. However, when adding this metadata, the extracted flow information is currently being cleared. This manifests in a problem when executing actions as elements of key are used when verifying some actions. For example a dec_ttl action verifies the proto of the flow. An example of a flow that fails as a result of this problem is: ovs-ofctl add-flow br0 "ip actions=dec_ttl,normal" This is a regression added by "datapath: Mega flow implementation", a1c564be1e2ffc31f8da09ab654c8ed987907fe5. CC: Andy Zhou Reported-by: Simon Horman Signed-off-by: Jesse Gross --- diff --git a/datapath/flow.c b/datapath/flow.c index 499e3e2d7..39de93166 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -1601,7 +1601,8 @@ int ovs_flow_metadata_from_nlattrs(struct sw_flow *flow, if (err) return -EINVAL; - ovs_match_init(&match, &flow->key, NULL); + memset(&match, 0, sizeof(match)); + match.key = &flow->key; err = metadata_from_nlattrs(&match, &attrs, a, false); if (err)