From 257c31c05ffc0ba3661a868676d3f125abc682e2 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Wed, 26 Oct 2016 23:24:10 +0100 Subject: [PATCH] [#2846] Fix splitting IPv6 from external IP alert message --- deluge/core/torrentmanager.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 491b10e84..3849c1a92 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -1273,9 +1273,13 @@ class TorrentManager(component.Component): """Alert handler for libtorrent external_ip_alert Note: - alert.message format is: "external IP received: 0.0.0.0" + The alert.message IPv4 address format is: + 'external IP received: 0.0.0.0' + and IPv6 address format is: + 'external IP received: 0:0:0:0:0:0:0:0' """ - external_ip = decode_string(alert.message()).split(':')[1].strip() + + external_ip = decode_string(alert.message()).split(' ')[-1] log.info("on_alert_external_ip: %s", external_ip) component.get("EventManager").emit(ExternalIPEvent(external_ip))