diff options
author | Thomas Haller <thaller@redhat.com> | 2014-05-16 17:40:34 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-05-30 17:02:31 +0200 |
commit | 1701a70b9eba0a0bc9db2bc253de352675fac915 (patch) | |
tree | 606e2e8e1f5c773b8415e06bf3e7125b919ef6e9 | |
parent | 891eb83f459ef09fcd3801c8406eb0e00d6c808f (diff) |
core: set NMSettingBridge:mac-address when creating new bridge
This feature requires recent support from the kernel.
Most notably these upstream kernel commits are required:
- 92c0574f11598c8036f81e27d2e8bdd6eed7d76d
- 43598813386f6205edf3c21f1fe97f731ccb4f15
- 30313a3d5794472c3548d7288e306a5492030370
The latter of them was merged to upstream kernel version 3.15-rc5.
https://bugzilla.gnome.org/show_bug.cgi?id=729844
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r-- | src/devices/nm-device-bridge.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c index eb7f5ad6fd..663f3188f8 100644 --- a/src/devices/nm-device-bridge.c +++ b/src/devices/nm-device-bridge.c @@ -438,13 +438,22 @@ NMDevice * nm_device_bridge_new_for_connection (NMConnection *connection) { const char *iface; + NMSettingBridge *s_bridge; + const GByteArray *mac_address; g_return_val_if_fail (connection != NULL, NULL); iface = nm_connection_get_virtual_iface_name (connection); g_return_val_if_fail (iface != NULL, NULL); - if ( !nm_platform_bridge_add (iface, NULL, 0) + s_bridge = nm_connection_get_setting_bridge (connection); + g_return_val_if_fail (s_bridge, NULL); + + mac_address = nm_setting_bridge_get_mac_address (s_bridge); + + if ( !nm_platform_bridge_add (iface, + mac_address ? mac_address->data : NULL, + mac_address ? mac_address->len : 0) && nm_platform_get_error () != NM_PLATFORM_ERROR_EXISTS) { nm_log_warn (LOGD_DEVICE | LOGD_BRIDGE, "(%s): failed to create bridge master interface for '%s': %s", iface, nm_connection_get_id (connection), |