summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>2013-06-18 16:35:25 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-06-20 06:41:30 +0900
commit852c2e882f51225f3f09a75f09b965490097c341 (patch)
treea22ff824274ade75513f95ff865942f44e75fee0
parent727d7bd356e4a0291a8b6fbeb83c3efdc5ac1a6e (diff)
datapath_connection_factory deal with None datapath.id
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/controller/controller.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ryu/controller/controller.py b/ryu/controller/controller.py
index 66d50a32..d6bc3def 100644
--- a/ryu/controller/controller.py
+++ b/ryu/controller/controller.py
@@ -315,6 +315,9 @@ def datapath_connection_factory(socket, address):
# Especially malicious switch can send malformed packet,
# the parser raise exception.
# Can we do anything more graceful?
- LOG.error("Error in the datapath %s from %s",
- dpid_to_str(datapath.id), address)
+ if datapath.id is None:
+ dpid_str = "%s" % datapath.id
+ else:
+ dpid_str = dpid_to_str(datapath.id)
+ LOG.error("Error in the datapath %s from %s", dpid_str, address)
raise