diff --git a/deluge/core/core.py b/deluge/core/core.py index 1ca6f92d8..a73bb6485 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -134,8 +134,11 @@ class Core(component.Component): # store the one in the config so we can restore it on shutdown self.__old_interface = None if listen_interface: - self.__old_interface = self.config["listen_interface"] - self.config["listen_interface"] = listen_interface + if deluge.common.is_ip(listen_interface): + self.__old_interface = self.config["listen_interface"] + self.config["listen_interface"] = listen_interface + else: + log.error("Invalid listen interface (must be IP Address): %s", listen_interface) def start(self): """Starts the core""" diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 52feb5555..149208de1 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -586,7 +586,9 @@ class Preferences(component.Component): new_core_config["outgoing_ports"] = outgoing_ports new_core_config["random_outgoing_ports"] = \ self.glade.get_widget("chk_random_outgoing_ports").get_active() - new_core_config["listen_interface"] = self.glade.get_widget("entry_interface").get_text() + incoming_address = self.glade.get_widget("entry_interface").get_text().strip() + if deluge.common.is_ip(incoming_address) or not incoming_address: + new_core_config["listen_interface"] = incoming_address new_core_config["peer_tos"] = self.glade.get_widget("entry_peer_tos").get_text() new_core_config["dht"] = self.glade.get_widget("chk_dht").get_active() new_core_config["upnp"] = self.glade.get_widget("chk_upnp").get_active()