summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/nc-config.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2014-04-07 08:58:57 +0800
committerJeremy Kerr <jk@ozlabs.org>2014-04-07 11:49:08 +0800
commit0dd467aef0f1e104faf8ad5b1d4deaaf71732278 (patch)
tree50549a07b97f5a65498347648ff12b8ac2e93894 /ui/ncurses/nc-config.c
parentae3c354e844698bdb4ed35a6845aa9dca1e9205f (diff)
downloadtalos-petitboot-0dd467aef0f1e104faf8ad5b1d4deaaf71732278.tar.gz
talos-petitboot-0dd467aef0f1e104faf8ad5b1d4deaaf71732278.zip
ui/ncurses: clear DNS server setting before appending new servers
Currently, we have a bug where newly-configured DNS servers are appended to the existing set of servers, rather than replacing them. This change clears the existing servers out before adding the newly-configured ones. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses/nc-config.c')
-rw-r--r--ui/ncurses/nc-config.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c
index 64d0619..f4fa073 100644
--- a/ui/ncurses/nc-config.c
+++ b/ui/ncurses/nc-config.c
@@ -249,6 +249,10 @@ static int screen_process_form(struct config_screen *screen)
}
str = widget_textbox_get_value(screen->widgets.dns_f);
+ talloc_free(config->network.dns_servers);
+ config->network.dns_servers = NULL;
+ config->network.n_dns_servers = 0;
+
if (str && strlen(str)) {
char *dns, *tmp;
int i;
OpenPOWER on IntegriCloud