summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-04-29 20:40:00 +0200
committerThomas Haller <thaller@redhat.com>2020-05-08 08:02:48 +0200
commit83830badda2fc6ce2e4fd779c836dae7a33d43b2 (patch)
tree673dc5fa90baf64dfba99ed2746d0529185830c0 /src
parent0b2ecf5e35801ef89129040119e404d0eaeb856e (diff)
downloadNetworkManager-83830badda2fc6ce2e4fd779c836dae7a33d43b2.tar.gz
device: use NM_G_PARAM_SPEC_GET_DEFAULT_*() in NMDeviceBridge's commit_option()
Diffstat (limited to 'src')
-rw-r--r--src/devices/nm-device-bridge.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c
index 4ca3b5b043..05d7c8fcc5 100644
--- a/src/devices/nm-device-bridge.c
+++ b/src/devices/nm-device-bridge.c
@@ -398,15 +398,12 @@ commit_option (NMDevice *device, NMSetting *setting, const Option *option, gbool
/* zero means "unspecified" for some NM properties but isn't in the
* allowed kernel range, so reset the property to the default value.
*/
- if (option->default_if_zero && uval == 0) {
- g_value_unset (&val);
- g_value_init (&val, G_PARAM_SPEC_VALUE_TYPE (pspec));
- g_param_value_set_default (pspec, &val);
-
+ if ( option->default_if_zero
+ && uval == 0) {
if (pspec->value_type == G_TYPE_UINT64)
- uval = g_value_get_uint64 (&val);
+ uval = NM_G_PARAM_SPEC_GET_DEFAULT_UINT64 (pspec);
else
- uval = (guint) g_value_get_uint (&val);
+ uval = NM_G_PARAM_SPEC_GET_DEFAULT_UINT (pspec);
}
/* Linux kernel bridge interfaces use 'centiseconds' for time-based values.