summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2018-10-25 23:11:33 +0200
committerChristian Poessinger <christian@poessinger.com>2018-10-25 23:18:36 +0200
commit710fb88625e4f23a694931ad8bba8c91e0e21aba (patch)
tree978d0ca8630d3962f9560ee042b47ffcc255cb70
parentde131151b2c52c6d91ce586066433e7c0afc2080 (diff)
downloadvyos-1x-710fb88625e4f23a694931ad8bba8c91e0e21aba.tar.gz
vyos-1x-710fb88625e4f23a694931ad8bba8c91e0e21aba.zip
T938: do not bind DHCP relay to default port if unspecified
Binding isc-dhcp-relay to its default port (67 e.g. for IPv4) will result in an error when starting up the service: bad: ---- $ dhcrelay -q -4 -p 67 -c 10 -A 576 -m discard -i eth0.21 -i eth0 10.253.253.1 binding to user-specified port 67 good: ----- $ dhcrelay -q -4 -c 10 -A 576 -m discard -i eth0.21 -i eth0 10.253.253.1 Setting removed from the IPv6 implementation, too!
-rwxr-xr-xsrc/conf_mode/dhcp_relay.py4
-rwxr-xr-xsrc/conf_mode/dhcpv6_relay.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/conf_mode/dhcp_relay.py b/src/conf_mode/dhcp_relay.py
index f757491e0..61b494b7e 100755
--- a/src/conf_mode/dhcp_relay.py
+++ b/src/conf_mode/dhcp_relay.py
@@ -43,14 +43,14 @@ SERVERS="{{ server | join(' ') }}"
INTERFACES="{{ interface | join(' ') }}"
# Additional options that are passed to the DHCP relay daemon?
-OPTIONS="-4 -p {{ port }} {{ options | join(' ') }}"
+OPTIONS="-4 {% if port -%} -p {{ port }}{%- endif %} {{ options | join(' ') }}"
"""
default_config_data = {
'interface': [],
'server': [],
'options': [],
- 'port': '67',
+ 'port': '',
'hop_count': '10',
'relay_agent_packets': 'forward'
}
diff --git a/src/conf_mode/dhcpv6_relay.py b/src/conf_mode/dhcpv6_relay.py
index c8b3eca6d..959bf0496 100755
--- a/src/conf_mode/dhcpv6_relay.py
+++ b/src/conf_mode/dhcpv6_relay.py
@@ -31,13 +31,13 @@ config_tmpl = """
# Defaults for isc-dhcpv6-relay initscript sourced by /etc/init.d/isc-dhcpv6-relay
-OPTIONS="-6 -l {{ listen_addr | join('-l ') }} -p {{ port }} {{ options | join(' ') }} -u {{ upstream_addr | join('-u ') }}"
+OPTIONS="-6 -l {{ listen_addr | join('-l ') }} {% if port -%} -p {{ port }}{%- endif %} {{ options | join(' ') }} -u {{ upstream_addr | join('-u ') }}"
"""
default_config_data = {
'listen_addr': [],
'upstream_addr': [],
- 'port': '547',
+ 'port': '',
'options': [],
}