Skip to content

Commit

Permalink
networkmanager: Reset static addresses when switching to DHCP
Browse files Browse the repository at this point in the history
This is what people expect.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1401426
  • Loading branch information
mvollmer committed Jul 23, 2019
1 parent 31c3500 commit 23163b5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pkg/networkmanager/interfaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand Down Expand Up @@ -3320,8 +3322,13 @@ PageNetworkIpSettings.prototype = {
$('<div>').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')),
$('<br>'),
dns_table =
Expand Down

0 comments on commit 23163b5

Please sign in to comment.