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>
This commit is contained in:
YAMAMOTO Takashi 2013-06-18 16:35:25 +09:00 committed by FUJITA Tomonori
parent 727d7bd356
commit 852c2e882f

View File

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