X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=ofproto%2Fofproto-dpif.c;h=44e7bbc2ab9d746b448ceecf09ea8552a0c7a257;hb=83b03fe05e7a6734b2096dab86937294769987c6;hp=6561c65d5bb2255e253dd936e46b8ae4e17de038;hpb=a6313b253a2a6b8d5fecc3967f8ab492575c5845;p=cascardo%2Fovs.git diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 6561c65d5..44e7bbc2a 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1407,7 +1407,6 @@ add_internal_flows(struct ofproto_dpif *ofproto) controller->max_len = UINT16_MAX; controller->controller_id = 0; controller->reason = OFPR_NO_MATCH; - ofpact_pad(&ofpacts); error = add_internal_miss_flow(ofproto, id++, &ofpacts, &ofproto->miss_rule); @@ -5660,22 +5659,17 @@ ofproto_dpif_add_internal_flow(struct ofproto_dpif *ofproto, struct rule_dpif *rule; int error; - ofm.fm.match = *match; - ofm.fm.priority = priority; - ofm.fm.new_cookie = htonll(0); - ofm.fm.cookie = htonll(0); - ofm.fm.cookie_mask = htonll(0); - ofm.fm.modify_cookie = false; - ofm.fm.table_id = TBL_INTERNAL; - ofm.fm.command = OFPFC_ADD; - ofm.fm.idle_timeout = idle_timeout; - ofm.fm.hard_timeout = 0; - ofm.fm.importance = 0; - ofm.fm.buffer_id = 0; - ofm.fm.out_port = 0; - ofm.fm.flags = OFPUTIL_FF_HIDDEN_FIELDS | OFPUTIL_FF_NO_READONLY; - ofm.fm.ofpacts = ofpacts->data; - ofm.fm.ofpacts_len = ofpacts->size; + ofm.fm = (struct ofputil_flow_mod) { + .match = *match, + .priority = priority, + .table_id = TBL_INTERNAL, + .command = OFPFC_ADD, + .idle_timeout = idle_timeout, + .flags = OFPUTIL_FF_HIDDEN_FIELDS | OFPUTIL_FF_NO_READONLY, + .ofpacts = ofpacts->data, + .ofpacts_len = ofpacts->size, + .delete_reason = OVS_OFPRR_NONE, + }; error = ofproto_flow_mod(&ofproto->up, &ofm); if (error) { @@ -5704,15 +5698,13 @@ ofproto_dpif_delete_internal_flow(struct ofproto_dpif *ofproto, struct ofproto_flow_mod ofm; int error; - ofm.fm.match = *match; - ofm.fm.priority = priority; - ofm.fm.new_cookie = htonll(0); - ofm.fm.cookie = htonll(0); - ofm.fm.cookie_mask = htonll(0); - ofm.fm.modify_cookie = false; - ofm.fm.table_id = TBL_INTERNAL; - ofm.fm.flags = OFPUTIL_FF_HIDDEN_FIELDS | OFPUTIL_FF_NO_READONLY; - ofm.fm.command = OFPFC_DELETE_STRICT; + ofm.fm = (struct ofputil_flow_mod) { + .match = *match, + .priority = priority, + .table_id = TBL_INTERNAL, + .flags = OFPUTIL_FF_HIDDEN_FIELDS | OFPUTIL_FF_NO_READONLY, + .command = OFPFC_DELETE_STRICT, + }; error = ofproto_flow_mod(&ofproto->up, &ofm); if (error) {