From 3a1bb4ad0a366cc1782f281248f767a321368d52 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 9 Jan 2016 15:07:32 +0530 Subject: [PATCH] Use the new algorthm preferentially when getting external IP --- src/calibre/utils/mdns.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/calibre/utils/mdns.py b/src/calibre/utils/mdns.py index 2189041866..2a4fe745d8 100644 --- a/src/calibre/utils/mdns.py +++ b/src/calibre/utils/mdns.py @@ -89,7 +89,11 @@ _ext_ip = None def get_external_ip(): global _ext_ip if _ext_ip is None: - _ext_ip = _get_external_ip() + from calibre.utils.ip_routing import get_default_route_src_address + try: + _ext_ip = get_default_route_src_address() + except Exception: + _ext_ip = _get_external_ip() return _ext_ip def start_server():