X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Ffail-open.c;h=cd1db94c52614d1bcab933d805a019191bf4a110;hb=6333182946ffd368eb7623d7408185a521058b46;hp=b028493d6b94b58059f43f509d8dadae4d5ae6c5;hpb=7cf8b2660f9813fe080a3f4fcc975099cb36417a;p=sliver-openvswitch.git diff --git a/ofproto/fail-open.c b/ofproto/fail-open.c index b028493d6..cd1db94c5 100644 --- a/ofproto/fail-open.c +++ b/ofproto/fail-open.c @@ -18,9 +18,11 @@ #include "fail-open.h" #include #include +#include "classifier.h" #include "flow.h" #include "mac-learning.h" #include "odp-util.h" +#include "ofp-util.h" #include "ofpbuf.h" #include "ofproto.h" #include "pktbuf.h" @@ -29,10 +31,10 @@ #include "status.h" #include "timeval.h" #include "vconn.h" - -#define THIS_MODULE VLM_fail_open #include "vlog.h" +VLOG_DEFINE_THIS_MODULE(fail_open); + /* * Fail-open mode. * @@ -256,14 +258,14 @@ static void fail_open_recover(struct fail_open *fo) { if (fail_open_is_active(fo)) { - flow_t flow; + struct cls_rule rule; VLOG_WARN("No longer in fail-open mode"); fo->last_disconn_secs = 0; fo->next_bogus_packet_in = LLONG_MAX; - memset(&flow, 0, sizeof flow); - ofproto_delete_flow(fo->ofproto, &flow, OVSFW_ALL, FAIL_OPEN_PRIORITY); + cls_rule_init_catchall(&rule, FAIL_OPEN_PRIORITY); + ofproto_delete_flow(fo->ofproto, &rule); } } @@ -282,7 +284,7 @@ fail_open_flushed(struct fail_open *fo) bool open = disconn_secs >= trigger_duration(fo); if (open) { union ofp_action action; - flow_t flow; + struct cls_rule rule; /* Set up a flow that matches every packet and directs them to * OFPP_NORMAL. */ @@ -290,9 +292,9 @@ fail_open_flushed(struct fail_open *fo) action.type = htons(OFPAT_OUTPUT); action.output.len = htons(sizeof action); action.output.port = htons(OFPP_NORMAL); - memset(&flow, 0, sizeof flow); - ofproto_add_flow(fo->ofproto, &flow, OVSFW_ALL, FAIL_OPEN_PRIORITY, - &action, 1, 0); + + cls_rule_init_catchall(&rule, FAIL_OPEN_PRIORITY); + ofproto_add_flow(fo->ofproto, &rule, &action, 1); } }