diff options
author | Yoshihiro Kaneko <ykaneko0929@gmail.com> | 2013-03-11 19:09:01 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2013-03-18 16:34:51 +0900 |
commit | 2ac7a9cf6c73997dbae38d45c02ab7f6b4097d58 (patch) | |
tree | 0e2fd95d161fb4cd188b77bf2d11b4b92a3f033f | |
parent | 9ad5a493af51c755b5aba8ced0aa30b59798aa94 (diff) |
ryu.controller.controller.Datapath: keep handler list regardless of state
The list of handler to be called for the OFP message should be kept
even if the state is changed in a handler.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/controller/controller.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ryu/controller/controller.py b/ryu/controller/controller.py index c753f014..79c63167 100644 --- a/ryu/controller/controller.py +++ b/ryu/controller/controller.py @@ -172,10 +172,11 @@ class Datapath(object): 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) + handlers = [handler for handler in + self.ofp_brick.get_handlers(ev) if self.state in + handler.dispatchers] for handler in handlers: - if self.state in handler.dispatchers: - handler(ev) + handler(ev) buf = buf[required_len:] required_len = ofproto_common.OFP_HEADER_SIZE |