X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Fflow.c;h=e90b36a93b5a37f2171d540216a1f277b6f7cd52;hb=c18ea70d06e980dc768166881c5aeac0b3491561;hp=0987fd2afc00ebaa69e6ed54af667368865ecedd;hpb=d656937779f5b987ec021c21189a0deab29fd64d;p=openvswitch diff --git a/datapath/flow.c b/datapath/flow.c index 0987fd2a..e90b36a9 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -103,13 +103,11 @@ void flow_used(struct sw_flow *flow, struct sk_buff *skb) spin_unlock_bh(&flow->lock); } -struct sw_flow_actions *flow_actions_alloc(u32 actions_len) +struct sw_flow_actions *flow_actions_alloc(const struct nlattr *actions) { + int actions_len = nla_len(actions); struct sw_flow_actions *sfa; - if (actions_len % NLA_ALIGNTO) - return ERR_PTR(-EINVAL); - /* At least DP_MAX_PORTS actions are required to be able to flood a * packet to every port. Factor of 2 allows for setting VLAN tags, * etc. */ @@ -121,6 +119,7 @@ struct sw_flow_actions *flow_actions_alloc(u32 actions_len) return ERR_PTR(-ENOMEM); sfa->actions_len = actions_len; + memcpy(sfa->actions, nla_data(actions), actions_len); return sfa; }