diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-04-03 20:11:59 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-04-03 20:59:12 +0200 |
commit | 7196f4d150697e11b676a0cb077130f7179685f3 (patch) | |
tree | c50c2775520137b67b74ce3711b400cd80c3175c | |
parent | e604b99c46b8fa4f1a2a7f0228085a85311ebfb8 (diff) | |
download | vyos-1x-7196f4d150697e11b676a0cb077130f7179685f3.tar.gz vyos-1x-7196f4d150697e11b676a0cb077130f7179685f3.zip |
[dhcpv6-relay] T1322: support multiple upstream servers
Add support for relaying a DHCPv6 packet to multiple servers on one upstream
interface.
(cherry picked from commit d5b113923aaa776f89749c820d6283b593e80c3a)
-rw-r--r-- | interface-definitions/dhcpv6-relay.xml | 3 | ||||
-rwxr-xr-x | src/conf_mode/dhcpv6_relay.py | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/interface-definitions/dhcpv6-relay.xml b/interface-definitions/dhcpv6-relay.xml index 15c76a098..0beb09d05 100644 --- a/interface-definitions/dhcpv6-relay.xml +++ b/interface-definitions/dhcpv6-relay.xml @@ -54,7 +54,7 @@ <children> <leafNode name="address"> <properties> - <help>IPv6 address to forward requests to</help> + <help>IPv6 address to forward requests to</help> <valueHelp> <format>ipv6</format> <description>IPv6 address of the DHCP server</description> @@ -62,6 +62,7 @@ <constraint> <validator name="ipv6-address"/> </constraint> + <multi/> </properties> </leafNode> </children> diff --git a/src/conf_mode/dhcpv6_relay.py b/src/conf_mode/dhcpv6_relay.py index 2b2b1f48b..8b8ceb358 100755 --- a/src/conf_mode/dhcpv6_relay.py +++ b/src/conf_mode/dhcpv6_relay.py @@ -60,9 +60,10 @@ def get_config(): if conf.exists('upstream-interface'): interfaces = conf.list_nodes('upstream-interface') for intf in interfaces: - addr = conf.return_value('upstream-interface {0} address'.format(intf)) - server = addr + '%' + intf - relay['upstream_addr'].append(server) + addresses = conf.return_values('upstream-interface {0} address'.format(intf)) + for addr in addresses: + server = addr + '%' + intf + relay['upstream_addr'].append(server) # Maximum hop count. When forwarding packets, dhcrelay discards packets # which have reached a hop count of COUNT. Default is 10. Maximum is 255. |