diff options
| author | Michael Biebl <biebl@debian.org> | 2017-01-17 20:25:09 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2017-01-17 20:25:09 +0100 |
| commit | 58f8be580039b0575b197b9573a1c92745d96d30 (patch) | |
| tree | 2c226233f623a0dcb529be0eb8cdf97e4a2ae0c0 /src/devices/nm-device-bridge.c | |
| parent | 45cb5bb3c0e6edb887cf69b417fcaf7053814a9b (diff) | |
New upstream version 1.5.90 upstream/1.5.90
Diffstat (limited to 'src/devices/nm-device-bridge.c')
| -rw-r--r-- | src/devices/nm-device-bridge.c | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c index c35d2863..613d59cd 100644 --- a/src/devices/nm-device-bridge.c +++ b/src/devices/nm-device-bridge.c @@ -20,30 +20,34 @@ #include "nm-default.h" +#include "nm-device-bridge.h" + #include <stdlib.h> -#include "nm-device-bridge.h" #include "NetworkManagerUtils.h" #include "nm-device-private.h" -#include "nm-enum-types.h" -#include "nm-platform.h" +#include "platform/nm-platform.h" #include "nm-device-factory.h" #include "nm-core-internal.h" -#include "nmdbus-device-bridge.h" +#include "introspection/org.freedesktop.NetworkManager.Device.Bridge.h" #include "nm-device-logging.h" _LOG_DECLARE_SELF(NMDeviceBridge); -G_DEFINE_TYPE (NMDeviceBridge, nm_device_bridge, NM_TYPE_DEVICE) +/*****************************************************************************/ -#define NM_DEVICE_BRIDGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_BRIDGE, NMDeviceBridgePrivate)) +struct _NMDeviceBridge { + NMDevice parent; +}; -typedef struct { - int dummy; -} NMDeviceBridgePrivate; +struct _NMDeviceBridgeClass { + NMDeviceClass parent; +}; + +G_DEFINE_TYPE (NMDeviceBridge, nm_device_bridge, NM_TYPE_DEVICE) -/******************************************************************/ +/*****************************************************************************/ static NMDeviceCapabilities get_generic_capabilities (NMDevice *dev) @@ -121,7 +125,7 @@ complete_connection (NMDevice *device, return TRUE; } -/******************************************************************/ +/*****************************************************************************/ typedef struct { const char *name; @@ -312,6 +316,9 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) if (ret != NM_ACT_STAGE_RETURN_SUCCESS) return ret; + if (!nm_device_hw_addr_set_cloned (device, nm_device_get_applied_connection (device), FALSE)) + return NM_ACT_STAGE_RETURN_FAILURE; + commit_master_options (device, nm_connection_get_setting_bridge (connection)); return NM_ACT_STAGE_RETURN_SUCCESS; @@ -411,7 +418,7 @@ create_and_realize (NMDevice *device, return TRUE; } -/******************************************************************/ +/*****************************************************************************/ static void nm_device_bridge_init (NMDeviceBridge * self) @@ -421,11 +428,8 @@ nm_device_bridge_init (NMDeviceBridge * self) static void nm_device_bridge_class_init (NMDeviceBridgeClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); NMDeviceClass *parent_class = NM_DEVICE_CLASS (klass); - g_type_class_add_private (object_class, sizeof (NMDeviceBridgePrivate)); - NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_BRIDGE_SETTING_NAME, NM_LINK_TYPE_BRIDGE) parent_class->get_generic_capabilities = get_generic_capabilities; @@ -441,16 +445,17 @@ nm_device_bridge_class_init (NMDeviceBridgeClass *klass) parent_class->act_stage1_prepare = act_stage1_prepare; parent_class->enslave_slave = enslave_slave; parent_class->release_slave = release_slave; + parent_class->get_configured_mtu = nm_device_get_configured_mtu_for_wired; nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), NMDBUS_TYPE_DEVICE_BRIDGE_SKELETON, NULL); } -/*************************************************************/ +/*****************************************************************************/ -#define NM_TYPE_BRIDGE_FACTORY (nm_bridge_factory_get_type ()) -#define NM_BRIDGE_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_BRIDGE_FACTORY, NMBridgeFactory)) +#define NM_TYPE_BRIDGE_DEVICE_FACTORY (nm_bridge_device_factory_get_type ()) +#define NM_BRIDGE_DEVICE_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_BRIDGE_DEVICE_FACTORY, NMBridgeDeviceFactory)) static NMDevice * create_device (NMDeviceFactory *factory, @@ -472,6 +477,5 @@ create_device (NMDeviceFactory *factory, NM_DEVICE_FACTORY_DEFINE_INTERNAL (BRIDGE, Bridge, bridge, NM_DEVICE_FACTORY_DECLARE_LINK_TYPES (NM_LINK_TYPE_BRIDGE) NM_DEVICE_FACTORY_DECLARE_SETTING_TYPES (NM_SETTING_BRIDGE_SETTING_NAME), - factory_iface->create_device = create_device; - ) - + factory_class->create_device = create_device; +); |