summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-01-06 10:58:06 +0100
committerChristian Poessinger <christian@poessinger.com>2019-01-06 10:58:06 +0100
commit89884d572bdf50c7d0c81e0f9f69855056f6f416 (patch)
treee863c55a4e5f09de27674f7471797221289d2eac /src
parentbdf528272a0d7e40dc46ada08ccad75bd8debae9 (diff)
parent60a8793aef2c1af95d7a992bfc0a381e1a8a61cd (diff)
downloadvyos-1x-89884d572bdf50c7d0c81e0f9f69855056f6f416.tar.gz
vyos-1x-89884d572bdf50c7d0c81e0f9f69855056f6f416.zip
Merge branch 'current' into crux
* current: T1129: replace quotes when dealing with 'subnet/global-parameters' T1129: fix handling of raw DHCP 'subnet-parameters' T1159: correct handling of SAs without PFS in "show vpn ipsec sa". T1147: Fix SNMP config file generation on newly installed systems Initial implementation of declarative config dict retrieval library. T1119: 'show vpn ipsec sa' shows tunnel twice in 1.2.0-RC11
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/dhcp_server.py13
-rwxr-xr-xsrc/op_mode/show_ipsec_sa.py2
2 files changed, 13 insertions, 2 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("&quot;",'"')
+
with open(config_file, 'w') as f:
f.write(config_text)
diff --git a/src/op_mode/show_ipsec_sa.py b/src/op_mode/show_ipsec_sa.py
index 568a5daeb..4c39aba66 100755
--- a/src/op_mode/show_ipsec_sa.py
+++ b/src/op_mode/show_ipsec_sa.py
@@ -32,7 +32,7 @@ def parse_ike_line(s):
# Get a list of all configured connections
with open('/etc/ipsec.conf', 'r') as f:
config = f.read()
- connections = re.findall(r'conn\s([^\s]+)\s*\n', config)
+ connections = set(re.findall(r'conn\s([^\s]+)\s*\n', config))
connections = list(filter(lambda s: s != '%default', connections))
status_data = []