openvswitch: Ensure flow is valid before executing ct
authorJoe Stringer <joestringer@nicira.com>
Tue, 6 Oct 2015 17:59:58 +0000 (10:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Oct 2015 12:03:05 +0000 (05:03 -0700)
The ct action uses parts of the flow key, so we need to ensure that it
is valid before executing that action.

Fixes: 7f8a436eaa2c "openvswitch: Add conntrack action"
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/openvswitch/actions.c

index 4cb93f9..c6a39bf 100644 (file)
@@ -1102,6 +1102,12 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
                        break;
 
                case OVS_ACTION_ATTR_CT:
+                       if (!is_flow_key_valid(key)) {
+                               err = ovs_flow_key_update(skb, key);
+                               if (err)
+                                       return err;
+                       }
+
                        err = ovs_ct_execute(ovs_dp_get_net(dp), skb, key,
                                             nla_data(a));