mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-09 13:30:20 +01:00
device/tun: set tun mode when the device is created
Otherwise after72c36bd6db("device/tun: fix reloading tun properties") the mode would remain always set to the default value "tun". Fixes:9110ad39c5
This commit is contained in:
parent
20e750a3c3
commit
4a9ae9d14e
1 changed files with 3 additions and 0 deletions
|
|
@ -451,6 +451,7 @@ create_device (NMDeviceFactory *factory,
|
|||
{
|
||||
NMSettingTun *s_tun;
|
||||
NMLinkType link_type = NM_LINK_TYPE_UNKNOWN;
|
||||
const char *mode;
|
||||
|
||||
if (plink) {
|
||||
link_type = plink->type;
|
||||
|
|
@ -471,12 +472,14 @@ create_device (NMDeviceFactory *factory,
|
|||
}
|
||||
|
||||
g_return_val_if_fail (link_type != NM_LINK_TYPE_UNKNOWN, NULL);
|
||||
mode = link_type == NM_LINK_TYPE_TUN ? "tun" : "tap";
|
||||
|
||||
return (NMDevice *) g_object_new (NM_TYPE_DEVICE_TUN,
|
||||
NM_DEVICE_IFACE, iface,
|
||||
NM_DEVICE_TYPE_DESC, "Tun",
|
||||
NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_TUN,
|
||||
NM_DEVICE_LINK_TYPE, link_type,
|
||||
NM_DEVICE_TUN_MODE, mode,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue