summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVictor Orlikowski <vjo@duke.edu>2015-12-25 05:46:52 +0000
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-12-30 14:18:39 +0900
commit6945ad3ef16e0dd11d7bbec9de19cae4844fe96d (patch)
treef5f1401d2bb0f92e4641427d233474c167f7c6ac
parent46f4ced1651ef7330fb67e3f76a36b6c73c0261e (diff)
Fix handling of state transition to config mode
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 <vjo@duke.edu> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/controller/ofp_handler.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/ryu/controller/ofp_handler.py b/ryu/controller/ofp_handler.py
index a7068cf2..b3c63dfd 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