diff options
Diffstat (limited to 'src/conf_mode/dhcp_server.py')
-rwxr-xr-x | src/conf_mode/dhcp_server.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/conf_mode/dhcp_server.py b/src/conf_mode/dhcp_server.py index 560c80e7f..22ada72a8 100755 --- a/src/conf_mode/dhcp_server.py +++ b/src/conf_mode/dhcp_server.py @@ -150,6 +150,12 @@ shared-network {{ network.name }} { {%- if subnet.domain_name %} option domain-name "{{ subnet.domain_name }}"; {%- endif -%} + {%- if subnet.subnet_parameters %} + # The following {{ subnet.subnet_parameters | length }} line(s) were added as subnet-parameters in the CLI and have not been validated + {%- for param in subnet.subnet_parameters %} + {{ param }} + {%- endfor -%} + {%- endif %} {%- if subnet.tftp_server %} option tftp-server-name "{{ subnet.tftp_server }}"; {%- endif -%} @@ -570,7 +576,7 @@ def get_config(): # # deprecate this and issue a warning like we do for DNS forwarding? if conf.exists('subnet-parameters'): - config['subnet_parameters'] = conf.return_values('subnet-parameters') + subnet['subnet_parameters'] = conf.return_values('subnet-parameters') # This option is used to identify a TFTP server and, if supported by the client, should have # the same effect as the server-name declaration. BOOTP clients are unlikely to support this @@ -767,6 +773,11 @@ def generate(dhcp): tmpl = jinja2.Template(config_tmpl) config_text = tmpl.render(dhcp) + + # Please see: https://phabricator.vyos.net/T1129 for quoting of the raw parameters + # we can pass to ISC DHCPd + config_text = config_text.replace(""",'"') + with open(config_file, 'w') as f: f.write(config_text) |