diff options
author | Rahul Thakur <rahul.thakur@iopsys.eu> | 2023-10-20 09:57:46 +0530 |
---|---|---|
committer | Christian Marangi <ansuelsmth@gmail.com> | 2023-10-20 16:04:59 +0200 |
commit | 002f180a97edd3ad7a2feeacb9fd0dd33ba13401 (patch) | |
tree | 791612d3872976d72c737f7f832dd292dc5cd0f1 | |
parent | b8e52852bd62236a2a84663b4592d221ebc64cb4 (diff) |
dnsmasq: add support for RA option 31
The option 31 in the RA specifies the DNS search list, the support
to configure this via UCI is missing in case dnsmasq-dhcpv6 is used.
This commit uses the uci option domain (same as is done by odhcpd) to
read and pass the DNS search list to dnsmasq, which is then used by RA.
Hence, with this commit, we are able to configure DNS search list for the
RA messages via the uci config when dnsmsaq-dhcpv6 is used.
Signed-off-by: Rahul Thakur <rahul.thakur@iopsys.eu>
-rwxr-xr-x | package/network/services/dnsmasq/files/dnsmasq.init | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index af5ca5822e..4cef2f4c29 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -568,6 +568,7 @@ dhcp_add() { config_get ra_management "$cfg" ra_management config_get ra_preference "$cfg" ra_preference config_get dns "$cfg" dns + config_get dns_sl "$cfg" domain config_list_foreach "$cfg" "interface_name" append_interface_name "$ifname" @@ -647,6 +648,13 @@ dhcp_add() { fi dhcp_option_append "option6:dns-server,$dnss" "$networkid" + + if [ -n "$dns_sl" ]; then + ddssl="" + for dd in $dns_sl; do append ddssl "$dd" ","; done + fi + + dhcp_option_append "option6:domain-search,$ddssl" "$networkid" fi dhcp_option_add "$cfg" "$networkid" 0 |