platform: support setting MAC address during nm_platform_link_gre_add()

We should set the MAC address of devices early on, and not later.
This commit is contained in:
Thomas Haller 2019-12-31 03:37:48 +01:00
parent cb4093fc8f
commit 81d83b9e00
3 changed files with 10 additions and 3 deletions

View file

@ -702,7 +702,12 @@ create_and_realize (NMDevice *device,
lnk_gre.output_flags = NM_GRE_KEY;
}
r = nm_platform_link_gre_add (nm_device_get_platform (device), iface, &lnk_gre, out_plink);
r = nm_platform_link_gre_add (nm_device_get_platform (device),
iface,
NULL,
0,
&lnk_gre,
out_plink);
if (r < 0) {
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
"Failed to create GRE interface '%s' for '%s': %s",

View file

@ -1387,12 +1387,14 @@ nm_platform_link_wireguard_add (NMPlatform *self,
static inline int
nm_platform_link_gre_add (NMPlatform *self,
const char *name,
const void *address,
size_t address_len,
const NMPlatformLnkGre *props,
const NMPlatformLink **out_link)
{
g_return_val_if_fail (props, -NME_BUG);
return nm_platform_link_add (self, props->is_tap ? NM_LINK_TYPE_GRETAP : NM_LINK_TYPE_GRE, name, 0, NULL, 0, props, out_link);
return nm_platform_link_add (self, props->is_tap ? NM_LINK_TYPE_GRETAP : NM_LINK_TYPE_GRE, name, 0, address, address_len, props, out_link);
}
static inline int

View file

@ -1265,7 +1265,7 @@ nmtstp_link_gre_add (NMPlatform *platform,
if (success)
pllink = nmtstp_assert_wait_for_link (platform, name, link_type, 100);
} else
success = NMTST_NM_ERR_SUCCESS (nm_platform_link_gre_add (platform, name, lnk, &pllink));
success = NMTST_NM_ERR_SUCCESS (nm_platform_link_gre_add (platform, name, NULL, 0, lnk, &pllink));
_assert_pllink (platform, success, pllink, name, link_type);