diff options
author | Christian Poessinger <christian@poessinger.com> | 2018-09-16 20:25:57 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2018-09-16 20:25:57 +0200 |
commit | c479f8db39fcfa9779146f1283ad7dbe5650d2cf (patch) | |
tree | 00fe159eb627a8a90d01867465b8018467e7317a /src/conf_mode/tftp_server.py | |
parent | 87174053a05740e9cccf7d9e6b855249783f085b (diff) | |
download | vyos-1x-c479f8db39fcfa9779146f1283ad7dbe5650d2cf.tar.gz vyos-1x-c479f8db39fcfa9779146f1283ad7dbe5650d2cf.zip |
T850: tftp server: improve non existing listen-address assignments
Diffstat (limited to 'src/conf_mode/tftp_server.py')
-rwxr-xr-x | src/conf_mode/tftp_server.py | 12 |
1 files changed, 10 insertions, 2 deletions
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 |