protocols/bgp: Log socket creation error

Helpful to track down why the bgp server is stopping when the user
running ryu does not have CAP_NET_BIND_SERVICE.

Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Jason Kölker 2016-02-08 17:02:56 +00:00 committed by FUJITA Tomonori
parent 4f1a4db7a4
commit 00c7d2918d

View File

@ -367,7 +367,9 @@ class Activity(object):
sock.bind(sa)
sock.listen(50)
listen_sockets[sa] = sock
except socket.error:
except socket.error as e:
LOG.error('Error creating socket: %s', e)
if sock:
sock.close()