summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWAMOTO Toshihiro <iwamoto@valinux.co.jp>2016-10-21 14:08:12 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-10-25 16:23:07 +0900
commit6792d6df2a28aac436eb9e2afb1fe07bd30a1831 (patch)
treeb1676235e15e81b89532ca691719e68f126f7ddd
parentdf95d2c6608556fa557d6d558a73014a910bf3ba (diff)
Log OFPErrorMsg.data as ascii when type is OFPET_HELLO_FAILED
OFPErrorMsg.data usually contains the offending OpenFlow message, but is an ASCII text string if its type is OFPET_HELLO_FAILED. Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/controller/ofp_handler.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ryu/controller/ofp_handler.py b/ryu/controller/ofp_handler.py
index b524a285..70ffc8cb 100644
--- a/ryu/controller/ofp_handler.py
+++ b/ryu/controller/ofp_handler.py
@@ -280,7 +280,10 @@ class OFPHandler(ryu.base.app_manager.RyuApp):
hex(msg.type), hex(msg.code), utils.binary_str(msg.data),
ofp.ofp_error_type_to_str(msg.type),
ofp.ofp_error_code_to_str(msg.type, msg.code))
- if len(msg.data) >= ofp.OFP_HEADER_SIZE:
+ if msg.type == ofp.OFPET_HELLO_FAILED:
+ self.logger.debug(
+ " `-- data: %s", msg.data.decode('ascii'))
+ elif len(msg.data) >= ofp.OFP_HEADER_SIZE:
(version, msg_type, msg_len, xid) = ofproto_parser.header(msg.data)
self.logger.debug(
" `-- data: version=%s, msg_type=%s, msg_len=%s, xid=%s\n"