mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 08:50:07 +01:00
bridge: set MTU at link creation time
https://bugzilla.redhat.com/show_bug.cgi?id=1778590
Signed-off-by: Antonio Cardace <acardace@redhat.com>
(cherry picked from commit 516c623618)
This commit is contained in:
parent
05e8b018ec
commit
8d8017a620
4 changed files with 13 additions and 2 deletions
|
|
@ -1027,6 +1027,7 @@ create_and_realize(NMDevice * device,
|
|||
const NMPlatformLink **out_plink,
|
||||
GError ** error)
|
||||
{
|
||||
NMSettingWired * s_wired;
|
||||
NMSettingBridge * s_bridge;
|
||||
const char * iface = nm_device_get_iface(device);
|
||||
const char * hwaddr;
|
||||
|
|
@ -1034,12 +1035,17 @@ create_and_realize(NMDevice * device,
|
|||
guint8 mac_address[NM_UTILS_HWADDR_LEN_MAX];
|
||||
NMPlatformLnkBridge props;
|
||||
int r;
|
||||
guint32 mtu = 0;
|
||||
|
||||
nm_assert(iface);
|
||||
|
||||
s_bridge = nm_connection_get_setting_bridge(connection);
|
||||
nm_assert(s_bridge);
|
||||
|
||||
s_wired = nm_connection_get_setting_wired(connection);
|
||||
if (s_wired)
|
||||
mtu = nm_setting_wired_get_mtu(s_wired);
|
||||
|
||||
hwaddr = nm_setting_bridge_get_mac_address(s_bridge);
|
||||
if (!hwaddr
|
||||
&& nm_device_hw_addr_get_cloned(device, connection, FALSE, &hwaddr_cloned, NULL, NULL)) {
|
||||
|
|
@ -1101,6 +1107,7 @@ create_and_realize(NMDevice * device,
|
|||
iface,
|
||||
hwaddr ? mac_address : NULL,
|
||||
hwaddr ? ETH_ALEN : 0,
|
||||
mtu,
|
||||
&props,
|
||||
out_plink);
|
||||
if (r < 0) {
|
||||
|
|
|
|||
|
|
@ -1557,6 +1557,7 @@ nm_platform_link_bridge_add(NMPlatform * self,
|
|||
const char * name,
|
||||
const void * address,
|
||||
size_t address_len,
|
||||
guint32 mtu,
|
||||
const NMPlatformLnkBridge *props,
|
||||
const NMPlatformLink ** out_link)
|
||||
{
|
||||
|
|
@ -1566,7 +1567,7 @@ nm_platform_link_bridge_add(NMPlatform * self,
|
|||
0,
|
||||
address,
|
||||
address_len,
|
||||
0,
|
||||
mtu,
|
||||
props,
|
||||
out_link);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1534,7 +1534,7 @@ nmtstp_link_bridge_add(NMPlatform * platform,
|
|||
}
|
||||
|
||||
if (!pllink) {
|
||||
r = nm_platform_link_bridge_add(platform, name, NULL, 0, lnk, &pllink);
|
||||
r = nm_platform_link_bridge_add(platform, name, NULL, 0, 0, lnk, &pllink);
|
||||
}
|
||||
|
||||
_assert_pllink(platform, r == 0, pllink, name, NM_LINK_TYPE_BRIDGE);
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ software_add(NMLinkType link_type, const char *name)
|
|||
name,
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
&nm_platform_lnk_bridge_default,
|
||||
NULL));
|
||||
case NM_LINK_TYPE_BOND:
|
||||
|
|
@ -131,6 +132,7 @@ software_add(NMLinkType link_type, const char *name)
|
|||
PARENT_NAME,
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
&nm_platform_lnk_bridge_default,
|
||||
NULL)))
|
||||
accept_signal(parent_added);
|
||||
|
|
@ -581,6 +583,7 @@ test_bridge_addr(void)
|
|||
DEVICE_NAME,
|
||||
addr,
|
||||
sizeof(addr),
|
||||
0,
|
||||
&nm_platform_lnk_bridge_default,
|
||||
&plink)));
|
||||
g_assert(plink);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue