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>
This commit is contained in:
Yoshihiro Kaneko 2013-03-11 19:09:01 +09:00 committed by FUJITA Tomonori
parent 9ad5a493af
commit 2ac7a9cf6c

View File

@ -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