diff options
author | Dan Williams <dcbw@redhat.com> | 2013-11-06 20:57:45 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2013-11-08 16:38:49 -0600 |
commit | 0626fe37d0b19cea6f473a0aac87e691d66441de (patch) | |
tree | 646a8450652095ffb554c8e5f7bafd13bb05d5e2 /src/devices/nm-device-generic.c | |
parent | 142bca6504f5d0c605ce19dc18daf3f783dc9e45 (diff) |
core: implement update_connection() for Generic devices
tun/tap, macvlan, and GRE devices may be bridge, bond, or team slaves
and should get that configuration detected at startup.
Diffstat (limited to 'src/devices/nm-device-generic.c')
-rw-r--r-- | src/devices/nm-device-generic.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/devices/nm-device-generic.c b/src/devices/nm-device-generic.c index f58c2ff79f..e435f5dff0 100644 --- a/src/devices/nm-device-generic.c +++ b/src/devices/nm-device-generic.c @@ -95,6 +95,13 @@ check_connection_compatible (NMDevice *device, return TRUE; } +static void +update_connection (NMDevice *device, NMConnection *connection) +{ + if (!nm_connection_get_setting_generic (connection)) + nm_connection_add_setting (connection, nm_setting_generic_new ()); +} + /**************************************************************/ NMDevice * @@ -184,6 +191,8 @@ nm_device_generic_class_init (NMDeviceGenericClass *klass) g_type_class_add_private (klass, sizeof (NMDeviceGenericPrivate)); + parent_class->connection_type = NM_SETTING_GENERIC_SETTING_NAME; + object_class->constructed = constructed; object_class->dispose = dispose; object_class->get_property = get_property; @@ -191,6 +200,7 @@ nm_device_generic_class_init (NMDeviceGenericClass *klass) parent_class->get_generic_capabilities = get_generic_capabilities; parent_class->check_connection_compatible = check_connection_compatible; + parent_class->update_connection = update_connection; /* properties */ g_object_class_install_property |