Hi all,

    Sometimes app can't get EventOFPSwitchFeatures ( CONFIG_DISPATCHER) event 
when OVS(especially, Openflow 1.0)  enter. But  EventOFPStateChange( 
MAIN_DISPATCHER ) was received.

In ryu/app/ofctl/service.py, add new switch by get EventOFPSwitchFeatures. If 
this event was not sent, _switches is empty.

Could the decorator of _switch_features_handler()  replace 
EventOFPSwitchFeatures with EventOFPStateChange?  Like this patch. Or it's not 
a good idea.

Thank u!

diff --git a/ryu/app/ofctl/service.py b/ryu/app/ofctl/service.py
index 19aebd4..2d98278 100644
--- a/ryu/app/ofctl/service.py
+++ b/ryu/app/ofctl/service.py
@@ -69,9 +69,9 @@ class OfctlService(app_manager.RyuApp):
         return (ofp_event.ofp_msg_to_ev_cls(type(msg)) ==
                 ofp_event.EventOFPErrorMsg)

-    @set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)
+    @set_ev_cls(ofp_event.EventOFPStateChange, MAIN_DISPATCHER)
     def _switch_features_handler(self, ev):
-        datapath = ev.msg.datapath
+        datapath = ev.datapath
         id = datapath.id
         assert isinstance(id, numbers.Integral)
         old_info = self._switches.get(id, None)








Please be advised that this email message (including any attachments) contains 
confidential information and may be legally privileged. If you are not the 
intended recipient, please destroy this message and all attachments from your 
system and do not further collect, process, or use them. Chunghwa Telecom and 
all its subsidiaries and associated companies shall not be liable for the 
improper or incomplete transmission of the information contained in this email 
nor for any delay in its receipt or damage to your system. If you are the 
intended recipient, please protect the confidential and/or personal information 
contained in this email with due care. Any unauthorized use, disclosure or 
distribution of this message in whole or in part is strictly prohibited.  Also, 
please self-inspect attachments and hyperlinks contained in this email to 
ensure the information security and to protect personal information.
------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to