summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-03-06 23:40:24 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-03-07 16:44:54 +0900
commit9fcc42d2e1adc23cb9eec5da780549401c5b1fad (patch)
tree2ed35a982bb1d23f6302b14476398f3e66dc3207
parenta85cb741ec0fc25e074866e83dd801e0c24ba4b3 (diff)
ofp: send events to others before calling own handlers
Some own handlers change the state so needs to send events before calling own handlers. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/controller/controller.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ryu/controller/controller.py b/ryu/controller/controller.py
index bf53f7ed..c753f014 100644
--- a/ryu/controller/controller.py
+++ b/ryu/controller/controller.py
@@ -170,13 +170,13 @@ class Datapath(object):
version, msg_type, msg_len, xid, buf)
#LOG.debug('queue msg %s cls %s', msg, msg.__class__)
ev = ofp_event.ofp_msg_to_ev(msg)
+ self.ofp_brick.send_event_to_observers(ev, self.state)
+
handlers = self.ofp_brick.get_handlers(ev)
for handler in handlers:
if self.state in handler.dispatchers:
handler(ev)
- self.ofp_brick.send_event_to_observers(ev, self.state)
-
buf = buf[required_len:]
required_len = ofproto_common.OFP_HEADER_SIZE