From 23163b50b2678bc360182bcc4f331e7db1f526f2 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Tue, 21 Feb 2017 13:42:11 +0200 Subject: [PATCH] networkmanager: Reset static addresses when switching to DHCP This is what people expect. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1401426 --- pkg/networkmanager/interfaces.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg/networkmanager/interfaces.js b/pkg/networkmanager/interfaces.js index 344076736e85..d98e92d360e7 100644 --- a/pkg/networkmanager/interfaces.js +++ b/pkg/networkmanager/interfaces.js @@ -3215,9 +3215,11 @@ PageNetworkIpSettings.prototype = { var auto_dns_search_btn, dns_search_table; var auto_routes_btn, routes_table; - function choicebox(p, choices) { + function choicebox(p, choices, callback) { var btn = select_btn( function (choice) { + if (callback) + callback(choice); params[p] = choice; self.update(); }, @@ -3320,8 +3322,13 @@ PageNetworkIpSettings.prototype = { $('
').append( addresses_table = tablebox(_("Addresses"), "addresses", [ "Address", prefix_text, "Gateway" ], [ "", "", "" ], - choicebox("method", (topic == "ipv4") - ? ipv4_method_choices : ipv6_method_choices) + choicebox("method", + (topic == "ipv4") ? ipv4_method_choices : ipv6_method_choices, + function (method) { + if (method == "auto") { + params.addresses = [ ]; + } + }) .css('display', 'inline-block')), $('
'), dns_table =