libnm: refactor some NMSetting to use direct properties for int64

This commit is contained in:
Thomas Haller
2021-12-28 10:50:05 +01:00
parent 72e523830c
commit 1d4a80cf7f
2 changed files with 8 additions and 14 deletions

View File

@@ -5833,6 +5833,13 @@ _nm_sett_info_property_override_create_array_ip_config(int addr_family)
.direct_offset =
NM_STRUCT_OFFSET_ENSURE_TYPE(guint32, NMSettingIPConfigPrivate, route_table));
_nm_properties_override_gobj(
properties_override,
obj_properties[PROP_ROUTE_METRIC],
&nm_sett_info_propert_type_direct_int64,
.direct_offset =
NM_STRUCT_OFFSET_ENSURE_TYPE(gint64, NMSettingIPConfigPrivate, route_metric));
_nm_properties_override_gobj(
properties_override,
obj_properties[PROP_IGNORE_AUTO_DNS],
@@ -5936,9 +5943,6 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
(NMUtilsCopyFunc) nm_ip_route_dup,
(GDestroyNotify) nm_ip_route_unref));
break;
case PROP_ROUTE_METRIC:
g_value_set_int64(value, priv->route_metric);
break;
case PROP_IGNORE_AUTO_ROUTES:
g_value_set_boolean(value, nm_setting_ip_config_get_ignore_auto_routes(setting));
break;
@@ -6028,9 +6032,6 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps
(NMUtilsCopyFunc) nm_ip_route_dup,
(GDestroyNotify) nm_ip_route_unref);
break;
case PROP_ROUTE_METRIC:
priv->route_metric = g_value_get_int64(value);
break;
case PROP_IGNORE_AUTO_ROUTES:
priv->ignore_auto_routes = g_value_get_boolean(value);
break;
@@ -6074,7 +6075,6 @@ _nm_setting_ip_config_private_init(gpointer self, NMSettingIPConfigPrivate *priv
priv->dns_search = g_ptr_array_new_with_free_func(g_free);
priv->addresses = g_ptr_array_new_with_free_func((GDestroyNotify) nm_ip_address_unref);
priv->routes = g_ptr_array_new_with_free_func((GDestroyNotify) nm_ip_route_unref);
priv->route_metric = -1;
}
static void