diff options
Diffstat (limited to 'src/core/devices/nm-device.c')
| -rw-r--r-- | src/core/devices/nm-device.c | 223 |
1 files changed, 115 insertions, 108 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index a11486d5..1d9f235a 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -101,6 +101,12 @@ typedef void (*ActivationHandleFunc)(NMDevice *self); typedef enum { + RELEASE_SLAVE_TYPE_NO_CONFIG, + RELEASE_SLAVE_TYPE_CONFIG, + RELEASE_SLAVE_TYPE_CONFIG_FORCE, +} ReleaseSlaveType; + +typedef enum { CLEANUP_TYPE_KEEP, CLEANUP_TYPE_REMOVED, CLEANUP_TYPE_DECONFIGURE, @@ -362,7 +368,6 @@ NM_GOBJECT_PROPERTIES_DEFINE(NMDevice, PROP_FIRMWARE_MISSING, PROP_NM_PLUGIN_MISSING, PROP_TYPE_DESC, - PROP_RFKILL_TYPE, PROP_IFINDEX, PROP_AVAILABLE_CONNECTIONS, PROP_PHYSICAL_PORT_ID, @@ -474,7 +479,6 @@ typedef struct _NMDevicePrivate { char *driver; char *driver_version; char *firmware_version; - RfKillType rfkill_type; bool firmware_missing : 1; bool nm_plugin_missing : 1; bool @@ -1135,7 +1139,7 @@ _prop_get_ipv6_dhcp_duid(NMDevice *self, duid_out = nm_utils_generate_duid_llt(arp_type, hwaddr_bin, hwaddr_len, - nm_utils_host_id_get_timestamp_ns() + nm_utils_host_id_get_timestamp_nsec() / NM_UTILS_NSEC_PER_SEC); } @@ -1236,7 +1240,7 @@ _prop_get_ipv6_dhcp_duid(NMDevice *self, * before. Let's compute the time (in seconds) from 0 to 3 years; then we'll * subtract it from the host_id timestamp. */ - time = nm_utils_host_id_get_timestamp_ns() / NM_UTILS_NSEC_PER_SEC; + time = nm_utils_host_id_get_timestamp_nsec() / NM_UTILS_NSEC_PER_SEC; /* don't use too old timestamps. They cannot be expressed in DUID-LLT and * would all be truncated to zero. */ @@ -3855,6 +3859,7 @@ update_external_connection(NMDevice *self) if (connection_new) { nm_settings_connection_update(settings_connection, + NULL, connection_new, NM_SETTINGS_CONNECTION_PERSIST_MODE_IN_MEMORY, NM_SETTINGS_CONNECTION_INT_FLAGS_NONE, @@ -3893,12 +3898,15 @@ _dev_l3_cfg_notify_cb(NML3Cfg *l3cfg, const NML3ConfigNotifyData *notify_data, N case NM_L3_CONFIG_NOTIFY_TYPE_PRE_COMMIT: { const NML3ConfigData *l3cd; + NMDeviceState state = nm_device_get_state(self); - /* FIXME(l3cfg): MTU handling should be moved to l3cfg. */ - l3cd = nm_l3cfg_get_combined_l3cd(l3cfg, TRUE); - if (l3cd) - priv->ip6_mtu = nm_l3_config_data_get_ip6_mtu(l3cd); - _commit_mtu(self); + if (state >= NM_DEVICE_STATE_IP_CONFIG && state < NM_DEVICE_STATE_DEACTIVATING) { + /* FIXME(l3cfg): MTU handling should be moved to l3cfg. */ + l3cd = nm_l3cfg_get_combined_l3cd(l3cfg, TRUE); + if (l3cd) + priv->ip6_mtu = nm_l3_config_data_get_ip6_mtu(l3cd); + _commit_mtu(self); + } return; } case NM_L3_CONFIG_NOTIFY_TYPE_POST_COMMIT: @@ -3976,7 +3984,9 @@ _dev_l3_cfg_commit_type_reset(NMDevice *self) commit_type = NM_L3_CFG_COMMIT_TYPE_NONE; goto do_set; case NM_DEVICE_SYS_IFACE_STATE_ASSUME: - commit_type = NM_L3_CFG_COMMIT_TYPE_ASSUME; + /* TODO: NM_DEVICE_SYS_IFACE_STATE_ASSUME, will be dropped from the code. + * Meanwhile, the commit type must be updated. */ + commit_type = NM_L3_CFG_COMMIT_TYPE_UPDATE; goto do_set; case NM_DEVICE_SYS_IFACE_STATE_MANAGED: commit_type = NM_L3_CFG_COMMIT_TYPE_UPDATE; @@ -4455,9 +4465,9 @@ _parent_set_ifindex(NMDevice *self, int parent_ifindex, gboolean force_check) _LOGD(LOGD_DEVICE, "parent: ifindex %d, no device", priv->parent_ifindex); else { _LOGD(LOGD_DEVICE, - "parent: ifindex %d, device %p, %s", + "parent: ifindex %d, device " NM_HASH_OBFUSCATE_PTR_FMT ", %s", priv->parent_ifindex, - priv->parent_device.obj, + NM_HASH_OBFUSCATE_PTR(priv->parent_device.obj), nm_device_get_iface(priv->parent_device.obj)); } @@ -4719,7 +4729,7 @@ nm_device_get_ip_iface_identifier(NMDevice *self, gboolean *out_is_token) { NMSettingIP6Config *s_ip6; - const char *token = NULL; + const char *token; g_return_val_if_fail(NM_IS_DEVICE(self), FALSE); @@ -4731,13 +4741,12 @@ nm_device_get_ip_iface_identifier(NMDevice *self, g_return_val_if_fail(s_ip6, FALSE); token = nm_setting_ip6_config_get_token(s_ip6); - if (token) + if (token) { NM_SET_OUT(out_is_token, TRUE); + return nm_utils_ipv6_interface_identifier_get_from_token(iid, token); + } } - if (token) - return nm_utils_ipv6_interface_identifier_get_from_token(iid, token); - else - return NM_DEVICE_GET_CLASS(self)->get_ip_iface_identifier(self, iid); + return NM_DEVICE_GET_CLASS(self)->get_ip_iface_identifier(self, iid); } const char * @@ -5162,12 +5171,17 @@ nm_device_get_applied_setting(NMDevice *self, GType setting_type) return connection ? nm_connection_get_setting(connection, setting_type) : NULL; } -RfKillType +NMRfkillType nm_device_get_rfkill_type(NMDevice *self) { + NMRfkillType t; + g_return_val_if_fail(NM_IS_DEVICE(self), FALSE); - return NM_DEVICE_GET_PRIVATE(self)->rfkill_type; + t = NM_DEVICE_GET_CLASS(self)->rfkill_type; + + nm_assert(NM_IN_SET(t, NM_RFKILL_TYPE_UNKNOWN, NM_RFKILL_TYPE_WLAN, NM_RFKILL_TYPE_WWAN)); + return t; } static const char * @@ -5875,11 +5889,9 @@ static SlaveInfo * find_slave_info(NMDevice *self, NMDevice *slave) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); - CList *iter; SlaveInfo *info; - c_list_for_each (iter, &priv->slaves) { - info = c_list_entry(iter, SlaveInfo, lst_slave); + c_list_for_each_entry (info, &priv->slaves, lst_slave) { if (info->slave == slave) return info; } @@ -5947,12 +5959,12 @@ nm_device_master_enslave_slave(NMDevice *self, NMDevice *slave, NMConnection *co } /** - * nm_device_master_release_one_slave: + * nm_device_master_release_slave: * @self: the master device * @slave: the slave device to release * @configure: whether @self needs to actually release @slave - * @force: force the release of @slave even if it wasn't added - * to @master by NetworkManager + * @release_type: whether @self needs to actually release slave + * and whether that is forced. * @reason: the state change reason for the @slave * * If @self is capable of enslaving other devices (ie it's a bridge, bond, team, @@ -5960,11 +5972,10 @@ nm_device_master_enslave_slave(NMDevice *self, NMDevice *slave, NMConnection *co * updates the state of @self and @slave to reflect its release. */ static void -nm_device_master_release_one_slave(NMDevice *self, - NMDevice *slave, - gboolean configure, - gboolean force, - NMDeviceStateReason reason) +nm_device_master_release_slave(NMDevice *self, + NMDevice *slave, + ReleaseSlaveType release_type, + NMDeviceStateReason reason) { NMDevicePrivate *priv; NMDevicePrivate *slave_priv; @@ -5973,17 +5984,22 @@ nm_device_master_release_one_slave(NMDevice *self, g_return_if_fail(NM_DEVICE(self)); g_return_if_fail(NM_DEVICE(slave)); - g_return_if_fail(!force || configure); + nm_assert(NM_IN_SET(release_type, + RELEASE_SLAVE_TYPE_NO_CONFIG, + RELEASE_SLAVE_TYPE_CONFIG, + RELEASE_SLAVE_TYPE_CONFIG_FORCE)); g_return_if_fail(NM_DEVICE_GET_CLASS(self)->release_slave != NULL); info = find_slave_info(self, slave); _LOGT(LOGD_CORE, - "master: release one slave %p/%s %s%s", - slave, + "master: release one slave " NM_HASH_OBFUSCATE_PTR_FMT "/%s %s%s", + NM_HASH_OBFUSCATE_PTR(slave), nm_device_get_iface(slave), !info ? "(not registered)" : (info->slave_is_enslaved ? "(enslaved)" : "(not enslaved)"), - force ? " (force-configure)" : (configure ? " (configure)" : "")); + release_type == RELEASE_SLAVE_TYPE_CONFIG_FORCE + ? " (force-configure)" + : (release_type == RELEASE_SLAVE_TYPE_CONFIG ? " (configure)" : "(no-config)")); if (!info) g_return_if_reached(); @@ -5995,8 +6011,11 @@ nm_device_master_release_one_slave(NMDevice *self, nm_assert(slave == info->slave); /* first, let subclasses handle the release ... */ - if (info->slave_is_enslaved || nm_device_sys_iface_state_is_external(slave) || force) - NM_DEVICE_GET_CLASS(self)->release_slave(self, slave, configure); + if (info->slave_is_enslaved || nm_device_sys_iface_state_is_external(slave) + || release_type >= RELEASE_SLAVE_TYPE_CONFIG_FORCE) + NM_DEVICE_GET_CLASS(self)->release_slave(self, + slave, + release_type >= RELEASE_SLAVE_TYPE_CONFIG); /* raise notifications about the release, including clearing is_enslaved. */ nm_device_slave_notify_release(slave, reason); @@ -6314,7 +6333,8 @@ device_recheck_slave_status(NMDevice *self, const NMPlatformLink *plink) plink_master = nm_platform_link_get(nm_device_get_platform(self), plink->master); plink_master_keep_alive = nmp_object_ref(NMP_OBJECT_UP_CAST(plink_master)); - if (master == NULL && plink_master && nm_streq0(plink_master->name, "ovs-system") + if (master == NULL && plink_master + && NM_IN_STRSET(plink_master->name, "ovs-system", "ovs-netdev") && plink_master->type == NM_LINK_TYPE_OPENVSWITCH) { _LOGD(LOGD_DEVICE, "the device claimed by openvswitch"); goto out; @@ -6330,11 +6350,10 @@ device_recheck_slave_status(NMDevice *self, const NMPlatformLink *plink) goto out; } - nm_device_master_release_one_slave(priv->master, - self, - FALSE, - FALSE, - NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); + nm_device_master_release_slave(priv->master, + self, + RELEASE_SLAVE_TYPE_NO_CONFIG, + NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); } if (master && NM_DEVICE_GET_CLASS(master)->enslave_slave) { @@ -6638,7 +6657,7 @@ static void link_changed_cb(NMPlatform *platform, int obj_type_i, int ifindex, - NMPlatformLink *info, + NMPlatformLink *pllink, int change_type_i, NMDevice *self) { @@ -6651,7 +6670,7 @@ link_changed_cb(NMPlatform *platform, priv = NM_DEVICE_GET_PRIVATE(self); if (ifindex == nm_device_get_ifindex(self)) { - if (!(info->n_ifi_flags & IFF_UP)) + if (!(pllink->n_ifi_flags & IFF_UP)) priv->device_link_changed_down = TRUE; if (!priv->device_link_changed_id) { priv->device_link_changed_id = g_idle_add(device_link_changed, self); @@ -7004,7 +7023,7 @@ sriov_op_queue(NMDevice *self, * * FIXME(shutdown): However, during shutdown we don't have a follow-up write request to cancel * this operation and we have to give it at least some time to complete. The solution is that - * we register a way to abort the last call during shutdown, and after NM_SHUTDOWN_TIMEOUT_MS + * we register a way to abort the last call during shutdown, and after NM_SHUTDOWN_TIMEOUT_MAX_MSEC * grace period we pull the plug and cancel it. */ op = g_slice_new(SriovOp); @@ -7527,7 +7546,11 @@ slave_state_changed(NMDevice *slave, configure = priv->sys_iface_state == NM_DEVICE_SYS_IFACE_STATE_MANAGED && nm_device_sys_iface_state_get(slave) != NM_DEVICE_SYS_IFACE_STATE_EXTERNAL; - nm_device_master_release_one_slave(self, slave, configure, FALSE, reason); + nm_device_master_release_slave(self, + slave, + configure ? RELEASE_SLAVE_TYPE_CONFIG + : RELEASE_SLAVE_TYPE_NO_CONFIG, + reason); /* Bridge/bond/team interfaces are left up until manually deactivated */ if (c_list_is_empty(&priv->slaves) && priv->state == NM_DEVICE_STATE_ACTIVATED) _LOGD(LOGD_DEVICE, "last slave removed; remaining activated"); @@ -7565,8 +7588,8 @@ nm_device_master_add_slave(NMDevice *self, NMDevice *slave, gboolean configure) info = find_slave_info(self, slave); _LOGT(LOGD_CORE, - "master: add one slave %p/%s%s", - slave, + "master: add one slave " NM_HASH_OBFUSCATE_PTR_FMT "/%s%s", + NM_HASH_OBFUSCATE_PTR(slave), nm_device_get_iface(slave), info ? " (already registered)" : ""); @@ -7624,14 +7647,12 @@ nm_device_master_check_slave_physical_port(NMDevice *self, NMDevice *slave, NMLo NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); const char *slave_physical_port_id, *existing_physical_port_id; SlaveInfo *info; - CList *iter; slave_physical_port_id = nm_device_get_physical_port_id(slave); if (!slave_physical_port_id) return; - c_list_for_each (iter, &priv->slaves) { - info = c_list_entry(iter, SlaveInfo, lst_slave); + c_list_for_each_entry (info, &priv->slaves, lst_slave) { if (info->slave == slave) continue; @@ -7651,13 +7672,13 @@ nm_device_master_check_slave_physical_port(NMDevice *self, NMDevice *slave, NMLo } } -/* release all slaves */ void -nm_device_master_release_slaves(NMDevice *self) +nm_device_master_release_slaves_all(NMDevice *self) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); NMDeviceStateReason reason; - CList *iter, *safe; + SlaveInfo *info; + SlaveInfo *safe; /* Don't release the slaves if this connection doesn't belong to NM. */ if (nm_device_sys_iface_state_is_external(self)) @@ -7667,9 +7688,7 @@ nm_device_master_release_slaves(NMDevice *self) if (priv->state == NM_DEVICE_STATE_FAILED) reason = NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED; - c_list_for_each_safe (iter, safe, &priv->slaves) { - SlaveInfo *info = c_list_entry(iter, SlaveInfo, lst_slave); - + c_list_for_each_entry_safe (info, safe, &priv->slaves, lst_slave) { if (priv->activation_state_preserve_external_ports && nm_device_sys_iface_state_is_external(info->slave)) { _LOGT(LOGD_DEVICE, @@ -7677,7 +7696,7 @@ nm_device_master_release_slaves(NMDevice *self) nm_device_get_iface(info->slave)); continue; } - nm_device_master_release_one_slave(self, info->slave, TRUE, FALSE, reason); + nm_device_master_release_slave(self, info->slave, RELEASE_SLAVE_TYPE_CONFIG, reason); } /* We only need this flag for a short time. It served its purpose. Clear @@ -7852,11 +7871,10 @@ nm_device_removed(NMDevice *self, gboolean unconfigure_ip_config) if (priv->master) { /* this is called when something externally messes with the slave or during shut-down. * Release the slave from master, but don't touch the device. */ - nm_device_master_release_one_slave(priv->master, - self, - FALSE, - FALSE, - NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); + nm_device_master_release_slave(priv->master, + self, + RELEASE_SLAVE_TYPE_NO_CONFIG, + NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); } _dev_l3_register_l3cds(self, priv->l3cfg, FALSE, unconfigure_ip_config); @@ -8928,11 +8946,10 @@ master_ready(NMDevice *self, NMActiveConnection *active) _LOGD(LOGD_DEVICE, "master connection ready; master device %s", nm_device_get_iface(master)); if (priv->master && priv->master != master) - nm_device_master_release_one_slave(priv->master, - self, - FALSE, - FALSE, - NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); + nm_device_master_release_slave(priv->master, + self, + RELEASE_SLAVE_TYPE_NO_CONFIG, + NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); /* If the master didn't change, add-slave only rechecks whether to assume a connection. */ nm_device_master_add_slave(master, @@ -9214,11 +9231,10 @@ activate_stage1_device_prepare(NMDevice *self) if (master) master_ready(self, active); else if (priv->master) { - nm_device_master_release_one_slave(priv->master, - self, - TRUE, - TRUE, - NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); + nm_device_master_release_slave(priv->master, + self, + RELEASE_SLAVE_TYPE_CONFIG_FORCE, + NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); } nm_device_activate_schedule_stage2_device_config(self, TRUE); @@ -9434,7 +9450,7 @@ activate_stage2_device_config(NMDevice *self) NMActStageReturn ret; NMSettingWired *s_wired; gboolean no_firmware = FALSE; - CList *iter; + SlaveInfo *info; NMTernary accept_all_mac_addresses; nm_device_state_changed(self, NM_DEVICE_STATE_CONFIG, NM_DEVICE_STATE_REASON_NONE); @@ -9481,8 +9497,7 @@ activate_stage2_device_config(NMDevice *self) } /* If we have slaves that aren't yet enslaved, do that now */ - c_list_for_each (iter, &priv->slaves) { - SlaveInfo *info = c_list_entry(iter, SlaveInfo, lst_slave); + c_list_for_each_entry (info, &priv->slaves, lst_slave) { NMDeviceState slave_state = nm_device_get_state(info->slave); if (slave_state == NM_DEVICE_STATE_IP_CONFIG) @@ -9517,8 +9532,6 @@ activate_stage2_device_config(NMDevice *self) lldp_setup(self, NM_TERNARY_DEFAULT); - _commit_mtu(self); - nm_device_activate_schedule_stage3_ip_config(self, TRUE); } @@ -10410,14 +10423,12 @@ have_any_ready_slaves(NMDevice *self) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); SlaveInfo *info; - CList *iter; /* Any enslaved slave is "ready" in the generic case as it's - * at least >= NM_DEVCIE_STATE_IP_CONFIG and has had Layer 2 + * at least >= NM_DEVICE_STATE_IP_CONFIG and has had Layer 2 * properties set up. */ - c_list_for_each (iter, &priv->slaves) { - info = c_list_entry(iter, SlaveInfo, lst_slave); + c_list_for_each_entry (info, &priv->slaves, lst_slave) { if (NM_DEVICE_GET_PRIVATE(info->slave)->is_enslaved) return TRUE; } @@ -10440,7 +10451,7 @@ void nm_device_use_ip6_subnet(NMDevice *self, const NMPlatformIP6Address *subnet) { nm_auto_unref_l3cd_init NML3ConfigData *l3cd = NULL; - char sbuf[sizeof(_nm_utils_to_string_buffer)]; + char sbuf[NM_UTILS_TO_STRING_BUFFER_SIZE]; NMPlatformIP6Address address; l3cd = nm_device_create_l3_config_data(self, NM_IP_CONFIG_SOURCE_SHARED); @@ -11864,6 +11875,15 @@ activate_stage3_ip_config(NMDevice *self) nm_device_get_ip_iface(self)); } + /* We currently will attach ports in the state change NM_DEVICE_STATE_IP_CONFIG above. + * Note that kernel changes the MTU of bond ports, so we want to commit the MTU + * afterwards! + * + * This might reset the MTU to something different from the bond controller and + * it might not be a working configuration. But it's what the user asked for, so + * let's do it! */ + _commit_mtu(self); + ipv4_method = nm_device_get_effective_ip_config_method(self, AF_INET); if (nm_streq(ipv4_method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { /* "auto" usually means DHCPv4 or autoconf6, but it doesn't have to be. Subclasses @@ -12455,6 +12475,7 @@ can_reapply_change(NMDevice *self, NM_SETTING_CONNECTION_UUID, NM_SETTING_CONNECTION_STABLE_ID, NM_SETTING_CONNECTION_AUTOCONNECT, + NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES, NM_SETTING_CONNECTION_ZONE, NM_SETTING_CONNECTION_METERED, NM_SETTING_CONNECTION_LLDP, @@ -15085,7 +15106,7 @@ nm_device_cleanup(NMDevice *self, NMDeviceStateReason reason, CleanupType cleanu if (cleanup_type == CLEANUP_TYPE_DECONFIGURE) { /* master: release slaves */ - nm_device_master_release_slaves(self); + nm_device_master_release_slaves_all(self); /* Take out any entries in the routing table and any IP address the device had. */ if (ifindex > 0) { @@ -15109,12 +15130,12 @@ nm_device_cleanup(NMDevice *self, NMDeviceStateReason reason, CleanupType cleanu /* slave: mark no longer enslaved */ if (priv->master && priv->ifindex > 0 - && nm_platform_link_get_master(nm_device_get_platform(self), priv->ifindex) <= 0) - nm_device_master_release_one_slave(priv->master, - self, - FALSE, - FALSE, - NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); + && nm_platform_link_get_master(nm_device_get_platform(self), priv->ifindex) <= 0) { + nm_device_master_release_slave(priv->master, + self, + RELEASE_SLAVE_TYPE_NO_CONFIG, + NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED); + } lldp_setup(self, NM_TERNARY_FALSE); @@ -15614,7 +15635,7 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason, sett_conn ? nm_settings_connection_get_id(sett_conn) : "<unknown>"); /* Notify any slaves of the unexpected failure */ - nm_device_master_release_slaves(self); + nm_device_master_release_slaves_all(self); /* If the connection doesn't yet have a timestamp, set it to zero so that * we can distinguish between connections we've tried to activate and have @@ -17070,9 +17091,6 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) case PROP_TYPE_DESC: g_value_set_string(value, priv->type_desc); break; - case PROP_RFKILL_TYPE: - g_value_set_uint(value, priv->rfkill_type); - break; case PROP_AVAILABLE_CONNECTIONS: nm_dbus_utils_g_value_set_object_path_from_hash(value, priv->available_connections, TRUE); break; @@ -17208,10 +17226,6 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps /* construct-only */ priv->type_desc = g_value_dup_string(value); break; - case PROP_RFKILL_TYPE: - /* construct-only */ - priv->rfkill_type = g_value_get_uint(value); - break; case PROP_PERM_HW_ADDRESS: /* construct-only */ priv->hw_addr_perm = g_value_dup_string(value); @@ -17261,7 +17275,6 @@ nm_device_init(NMDevice *self) priv->capabilities = NM_DEVICE_CAP_NM_SUPPORTED; priv->state = NM_DEVICE_STATE_UNMANAGED; priv->state_reason = NM_DEVICE_STATE_REASON_NONE; - priv->rfkill_type = RFKILL_TYPE_UNKNOWN; priv->unmanaged_flags = NM_UNMANAGED_PLATFORM_INIT; priv->unmanaged_mask = priv->unmanaged_flags; priv->available_connections = g_hash_table_new_full(nm_direct_hash, NULL, g_object_unref, NULL); @@ -17664,6 +17677,8 @@ nm_device_class_init(NMDeviceClass *klass) klass->reapply_connection = reapply_connection; klass->set_platform_mtu = set_platform_mtu; + klass->rfkill_type = NM_RFKILL_TYPE_UNKNOWN; + obj_properties[PROP_UDI] = g_param_spec_string(NM_DEVICE_UDI, "", @@ -17821,14 +17836,6 @@ nm_device_class_init(NMDeviceClass *klass) "", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); - obj_properties[PROP_RFKILL_TYPE] = - g_param_spec_uint(NM_DEVICE_RFKILL_TYPE, - "", - "", - RFKILL_TYPE_WLAN, - RFKILL_TYPE_MAX, - RFKILL_TYPE_UNKNOWN, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); obj_properties[PROP_IFINDEX] = g_param_spec_int(NM_DEVICE_IFINDEX, "", "", |