From c479f8db39fcfa9779146f1283ad7dbe5650d2cf Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 16 Sep 2018 20:25:57 +0200 Subject: T850: tftp server: improve non existing listen-address assignments --- src/conf_mode/tftp_server.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/conf_mode/tftp_server.py b/src/conf_mode/tftp_server.py index b6cf5c09e..0984b4545 100755 --- a/src/conf_mode/tftp_server.py +++ b/src/conf_mode/tftp_server.py @@ -96,12 +96,20 @@ def verify(tftpd): raise ConfigError('TFTP server listen address must be configured!') for addr in tftpd['listen_ipv4']: + # we always bind to localhost + if '127.0.0.1' not in tftpd['listen_ipv4']: + tftpd['listen_ipv4'].append('127.0.0.1') + if not vyos.validate.is_addr_assigned(addr): - raise ConfigError('TFTP server IPv4 listen address "{0}" not configured!'.format(addr)) + print('WARNING: TFTP server listen address {0} not configured!'.format(addr)) for addr in tftpd['listen_ipv6']: + # we always bind to localhost + if '::1' not in tftpd['listen_ipv6']: + tftpd['listen_ipv6'].append('::1') + if not vyos.validate.is_addr_assigned(addr): - raise ConfigError('TFTP server IPv6 listen address "{0}" not configured!'.format(addr)) + print('WARNING: TFTP server listen address {0} not configured!'.format(addr)) return None -- cgit v1.2.3