For SNAT, don't store the pre-fragment L2 header before actions are applied.
[sliver-openvswitch.git] / datapath / dp_act.c
index 14eaac3..4c27c85 100644 (file)
@@ -26,7 +26,8 @@ validate_output(struct datapath *dp, const struct sw_flow_key *key,
 {
        struct ofp_action_output *oa = (struct ofp_action_output *)ah;
 
-       if (oa->port == htons(OFPP_NONE) || oa->port == key->in_port)
+       if (oa->port == htons(OFPP_NONE) || 
+                       (!(key->wildcards & OFPFW_IN_PORT) && oa->port == key->in_port)) 
                return OFPBAC_BAD_OUT_PORT;
 
        return ACT_VALIDATION_OK;
@@ -460,6 +461,7 @@ void execute_actions(struct datapath *dp, struct sk_buff *skb,
                struct ofp_action_header *ah = (struct ofp_action_header *)p;
                size_t len = htons(ah->len);
 
+               WARN_ON_ONCE(skb_shared(skb));
                if (prev_port != -1) {
                        do_output(dp, skb_clone(skb, GFP_ATOMIC),
                                  max_len, prev_port, ignore_no_fwd);