diff --git a/deluge/core/core.py b/deluge/core/core.py index a1571a25e..3c3b6b331 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -184,14 +184,8 @@ class Core(component.Component): self._old_outgoing_interface = None if outgoing_interface: - if not deluge.common.is_ip(outgoing_interface): - self._old_outgoing_interface = self.config['outgoing_interface'] - self.config['outgoing_interface'] = outgoing_interface - else: - log.error( - 'Invalid outgoing interface (must be adapter name): %s', - outgoing_interface, - ) + self._old_outgoing_interface = self.config['outgoing_interface'] + self.config['outgoing_interface'] = outgoing_interface # New release check information self.__new_release = None diff --git a/deluge/core/daemon.py b/deluge/core/daemon.py index 42f39a23c..84c4514a1 100644 --- a/deluge/core/daemon.py +++ b/deluge/core/daemon.py @@ -76,14 +76,18 @@ class Daemon(object): ): """ Args: - listen_interface (str, optional): The IP address to listen to bittorrent connections on. - outgoing_interface (str, optional): The IP address to open outgoing BitTorrent connections on. - interface (str, optional): Adapter name the daemon will listen for UI connections on. - port (int, optional): The port the daemon will listen for UI connections on. - standalone (bool, optional): If True the client is in Standalone mode otherwise, if - False, start the daemon as separate process. - read_only_config_keys (list of str, optional): A list of config keys that will not be - altered by core.set_config() RPC method. + listen_interface (str, optional): The IP address to listen to + BitTorrent connections on. + outgoing_interface (str, optional): The network interface name or + IP address to open outgoing BitTorrent connections on. + interface (str, optional): The IP address the daemon will + listen for UI connections on. + port (int, optional): The port the daemon will listen for UI + connections on. + standalone (bool, optional): If True the client is in Standalone + mode otherwise, if False, start the daemon as separate process. + read_only_config_keys (list of str, optional): A list of config + keys that will not be altered by core.set_config() RPC method. """ self.standalone = standalone self.pid_file = get_config_dir('deluged.pid') diff --git a/deluge/core/daemon_entry.py b/deluge/core/daemon_entry.py index fffc8c8c2..d62245c36 100644 --- a/deluge/core/daemon_entry.py +++ b/deluge/core/daemon_entry.py @@ -49,10 +49,12 @@ def add_daemon_options(parser): group.add_argument( '-o', '--outgoing-interface', - metavar='', + metavar='', dest='outgoing_interface', action='store', - help=_('The interface adapter name for outgoing BitTorrent connections.'), + help=_( + 'The network interface name or IP address for outgoing BitTorrent connections.' + ), ) group.add_argument( '--read-only-config-keys', diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py index 5d10b31ec..e3c935c99 100644 --- a/deluge/core/preferencesmanager.py +++ b/deluge/core/preferencesmanager.py @@ -194,10 +194,8 @@ class PreferencesManager(component.Component): self.__set_listen_on() def _on_set_outgoing_interface(self, key, value): - """ Set the adapter name for outgoing BitTorrent connections.""" - if not value or deluge.common.is_ip(value): - value = '' - value = value.strip() + """Set interface name or IP address for outgoing BitTorrent connections.""" + value = value.strip() if value else '' self.core.apply_session_settings({'outgoing_interfaces': value}) def _on_set_random_port(self, key, value): diff --git a/deluge/ui/console/modes/preferences/preference_panes.py b/deluge/ui/console/modes/preferences/preference_panes.py index 5781fc117..2bdf5a932 100644 --- a/deluge/ui/console/modes/preferences/preference_panes.py +++ b/deluge/ui/console/modes/preferences/preference_panes.py @@ -97,8 +97,7 @@ class BasePreferencePane(BaseInputPane, BaseWindow, PopupsHandler): conf_dict['listen_interface'] = listen_interface elif ipt.name == 'outgoing_interface': outgoing_interface = ipt.get_value().strip() - if not is_ip(outgoing_interface) or not outgoing_interface: - conf_dict['outgoing_interface'] = outgoing_interface + conf_dict['outgoing_interface'] = outgoing_interface elif ipt.name.startswith('proxy_'): if ipt.name == 'proxy_type': conf_dict.setdefault('proxy', {})['type'] = ipt.get_value() @@ -361,7 +360,8 @@ class NetworkPane(BasePreferencePane): self.add_text_input( 'outgoing_interface', _( - 'The interface adapter name for outgoing BitTorrent connections. (Leave empty for default.):' + 'The network interface name or IP address for outgoing ' + 'BitTorrent connections. (Leave empty for default.):' ), core_conf['outgoing_interface'], ) diff --git a/deluge/ui/gtkui/glade/preferences_dialog.ui b/deluge/ui/gtkui/glade/preferences_dialog.ui index 34509a444..69bbf4e36 100644 --- a/deluge/ui/gtkui/glade/preferences_dialog.ui +++ b/deluge/ui/gtkui/glade/preferences_dialog.ui @@ -2925,7 +2925,7 @@ used sparingly. True True -The interface adapter name for outgoing BitTorrent connections. (Leave empty for default.) +The network interface name or IP address for outgoing BitTorrent connections. (Leave empty for default.) 15 diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index be011efac..9c690a543 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -680,11 +680,9 @@ class Preferences(component.Component): incoming_address = self.builder.get_object('entry_interface').get_text().strip() if deluge.common.is_ip(incoming_address) or not incoming_address: new_core_config['listen_interface'] = incoming_address - outgoing_interface = ( + new_core_config['outgoing_interface'] = ( self.builder.get_object('entry_outgoing_interface').get_text().strip() ) - if not deluge.common.is_ip(outgoing_interface) or not outgoing_interface: - new_core_config['outgoing_interface'] = outgoing_interface new_core_config['peer_tos'] = self.builder.get_object( 'entry_peer_tos' ).get_text()