From dff8ab9d27726d380eb3d5eb8e4262929903e948 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 9 Jul 2019 18:10:32 +0200 Subject: T1497: remove duplicate values from name servers and search domains obtained from DHCP. --- src/conf_mode/host_name.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/conf_mode/host_name.py b/src/conf_mode/host_name.py index 5055faa65..27cc336d8 100755 --- a/src/conf_mode/host_name.py +++ b/src/conf_mode/host_name.py @@ -172,6 +172,11 @@ def generate(config): dhcp_ns.extend(ns) sd = [d for d in value if key == 'domains'] dhcp_sd.extend(sd) + # Prune duplicate values + # Not order preserving, but then when multiple DHCP clients are used, + # there can't be guarantees about the order anyway + dhcp_ns = list(set(dhcp_ns)) + dhcp_sd = list(set(dhcp_sd)) if not config['no_dhcp_ns']: config['nameserver'] += dhcp_ns -- cgit v1.2.3