Skip to content

Commit

Permalink
ipv6 support tcp connection with bgp open messages
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Xiao <xiaoquwl@gmail.com>
  • Loading branch information
xiaopeng163 committed Dec 29, 2015
1 parent 18bc0ff commit ce6538a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion yabgp/core/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ def connectionMade(self):
# Set the local BGP id from the local IP address if it's not set
if self.factory.bgp_id is None:
try:
self.factory.bgp_id = int(netaddr.IPAddress(self.transport.getHost().host))
local_host_addr = netaddr.IPAddress(self.transport.getHost().host)
if 'IPv6' in local_host_addr.info:
self.factory.bgp_id = int(netaddr.IPAddress('127.0.0.1'))
else:
self.factory.bgp_id = int(local_host_addr)
except Exception as e:
LOG.error(e)
error_str = traceback.format_exc()
Expand Down

0 comments on commit ce6538a

Please sign in to comment.