network: prevent ethernet device to switch back to 'on' state
Calling nm_client_deactivate_connection() stops a connection and set it back to auto-activation. In the case of ethernet, that means the ipconfig scripts start again and the ethernet device becomes 'on' again, even though the user clicked 'off' in the control center panel. https://bugzilla.gnome.org/show_bug.cgi?id=700300
This commit is contained in:
parent
baec81d357
commit
d1bbe95143
1 changed files with 1 additions and 5 deletions
|
@ -520,7 +520,6 @@ device_off_toggled (GtkSwitch *sw,
|
|||
NMClient *client;
|
||||
NMDevice *nm_device;
|
||||
NMConnection *connection;
|
||||
NMActiveConnection *a;
|
||||
|
||||
if (device->updating_device)
|
||||
return;
|
||||
|
@ -537,10 +536,7 @@ device_off_toggled (GtkSwitch *sw,
|
|||
NULL, NULL, NULL);
|
||||
}
|
||||
} else {
|
||||
a = nm_device_get_active_connection (nm_device);
|
||||
if (a) {
|
||||
nm_client_deactivate_connection (client, a);
|
||||
}
|
||||
nm_device_disconnect (nm_device, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue