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;
|
NMClient *client;
|
||||||
NMDevice *nm_device;
|
NMDevice *nm_device;
|
||||||
NMConnection *connection;
|
NMConnection *connection;
|
||||||
NMActiveConnection *a;
|
|
||||||
|
|
||||||
if (device->updating_device)
|
if (device->updating_device)
|
||||||
return;
|
return;
|
||||||
|
@ -537,10 +536,7 @@ device_off_toggled (GtkSwitch *sw,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
a = nm_device_get_active_connection (nm_device);
|
nm_device_disconnect (nm_device, NULL, NULL);
|
||||||
if (a) {
|
|
||||||
nm_client_deactivate_connection (client, a);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue