We have found, in production usage, a race condition in the transition to config mode.
If a sufficient number of events is being received, the reply to the FeaturesRequest may be received before the datapath is able to move into CONFIG_DISPATCHER state. As a result, the EventOFPSwitchFeatures handler may never fire (because the reply is received before the datapath has changed state). This patch also includes a minor typo fix. Signed-off-by: Victor J. Orlikowski <[email protected]> diff --git a/ryu/controller/ofp_handler.py b/ryu/controller/ofp_handler.py index a7068cf..fd9fb5f 100644 --- a/ryu/controller/ofp_handler.py +++ b/ryu/controller/ofp_handler.py @@ -181,14 +181,14 @@ class OFPHandler(ryu.base.app_manager.RyuApp): return datapath.set_version(max(usable_versions)) - # now send feature - features_reqeust = datapath.ofproto_parser.OFPFeaturesRequest(datapath) - datapath.send_msg(features_reqeust) - - # now move on to config state + # Move on to config state self.logger.debug('move onto config mode') datapath.set_state(CONFIG_DISPATCHER) + # Finally, send feature request + features_request = datapath.ofproto_parser.OFPFeaturesRequest(datapath) + datapath.send_msg(features_request) + @set_ev_handler(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER) def switch_features_handler(self, ev): msg = ev.msg Best, Victor -- Victor J. Orlikowski <> vjo@[cs.]duke.edu ------------------------------------------------------------------------------ _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
