From: Ben Pfaff Date: Thu, 19 Mar 2009 20:52:03 +0000 (-0700) Subject: secchan: When we flush the flow table, add the in-band control rules back in. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df6a2e1961749356b6ad9158b322516f035003fa;p=openvswitch secchan: When we flush the flow table, add the in-band control rules back in. ofproto_flush_flows() deletes all the flows from the flow table, even the ones added by in-band control. If that happens we need to add them back in. This should be the only place that the in-band control rules can get deleted, since their priorities are such that the controller cannot see or modify them. --- diff --git a/secchan/in-band.c b/secchan/in-band.c index b6b51d33..2315c44b 100644 --- a/secchan/in-band.c +++ b/secchan/in-band.c @@ -317,6 +317,16 @@ in_band_wait(struct in_band *in_band) } } +void +in_band_flushed(struct in_band *in_band) +{ + int i; + + for (i = 0; i < N_IB_RULES; i++) { + in_band->rules[i].installed = false; + } +} + int in_band_create(struct ofproto *ofproto, struct dpif *dpif, struct switch_status *ss, diff --git a/secchan/in-band.h b/secchan/in-band.h index 979580c7..a89dbd3a 100644 --- a/secchan/in-band.h +++ b/secchan/in-band.h @@ -49,5 +49,6 @@ int in_band_create(struct ofproto *, struct dpif *, struct switch_status *, void in_band_destroy(struct in_band *); void in_band_run(struct in_band *); void in_band_wait(struct in_band *); +void in_band_flushed(struct in_band *); #endif /* in-band.h */ diff --git a/secchan/ofproto.c b/secchan/ofproto.c index 3d69479b..e2c69d5d 100644 --- a/secchan/ofproto.c +++ b/secchan/ofproto.c @@ -1024,6 +1024,9 @@ ofproto_flush_flows(struct ofproto *ofproto) { classifier_for_each(&ofproto->cls, CLS_INC_ALL, destroy_rule, ofproto); dpif_flow_flush(&ofproto->dpif); + if (ofproto->in_band) { + in_band_flushed(ofproto->in_band); + } } static void