diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-10-05 18:47:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-05 18:47:31 +0200 |
commit | a093620f1525c46f5b63453ca703a9b027a01748 (patch) | |
tree | 53e6d87b75e62b7771ef1fd952d4a5917b6813a0 /src | |
parent | 65acae4868363117697ccefff10d0ef12fae9da4 (diff) | |
parent | 51a6eaa324775049ee666503ca0a63571750ac25 (diff) | |
download | vyos-1x-a093620f1525c46f5b63453ca703a9b027a01748.tar.gz vyos-1x-a093620f1525c46f5b63453ca703a9b027a01748.zip |
Merge pull request #562 from lucasec/dhcpv6-stateless
dhcpv6: T2961: support stateless dhcpv6 clients
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/dhcpv6_server.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/conf_mode/dhcpv6_server.py b/src/conf_mode/dhcpv6_server.py index 4ce4cada1..1777d4db7 100755 --- a/src/conf_mode/dhcpv6_server.py +++ b/src/conf_mode/dhcpv6_server.py @@ -65,6 +65,7 @@ def get_config(config=None): config = { 'name': network, 'disabled': False, + 'common': {}, 'subnet': [] } @@ -72,6 +73,31 @@ def get_config(config=None): if conf.exists(['disable']): config['disabled'] = True + # Common options shared among subnets. These can be overridden if + # the same option is specified on a per-subnet or per-host + # basis. These are the only options that can be handed out to + # stateless clients via an information-request message. + if conf.exists(['common-options']): + conf.set_level(base + ['shared-network-name', network, 'common-options']) + + # How often stateless clients should refresh their information. This is + # mostly taken as a hint by clients, and only if they request it. + # (if not specified, the server does not supply this to the client) + if conf.exists(['info-refresh-time']): + config['common']['info_refresh_time'] = conf.return_value(['info-refresh-time']) + + # The domain-search option specifies a 'search list' of Domain Names to be used + # by the client to locate not-fully-qualified domain names. + if conf.exists(['domain-search']): + config['common']['domain_search'] = conf.return_values(['domain-search']) + + # Specifies a list of Domain Name System name servers available to the client. + # Servers should be listed in order of preference. + if conf.exists(['name-server']): + config['common']['dns_server'] = conf.return_values(['name-server']) + + conf.set_level(base + ['shared-network-name', network]) + # check for multiple subnet configurations in a shared network if conf.exists(['subnet']): for net in conf.list_nodes(['subnet']): |