From: Lennart Poettering Date: Fri, 15 Feb 2019 10:31:25 +0000 (+0100) Subject: Merge pull request #11382 from keszybz/udev-predictable-macs X-Git-Tag: v242-rc1~332 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e5d21c24a0902a6f692dce556dbaee26500b934b;p=thirdparty%2Fsystemd.git Merge pull request #11382 from keszybz/udev-predictable-macs Allow MACAddressPolicy=persistent for all virtual devices --- e5d21c24a0902a6f692dce556dbaee26500b934b diff --cc src/libsystemd-network/network-internal.c index 0348e7fa9da,9e7838527c5..a0209caf3a8 --- a/src/libsystemd-network/network-internal.c +++ b/src/libsystemd-network/network-internal.c @@@ -46,15 -47,21 +47,21 @@@ int net_get_unique_predictable_data(sd_ assert(device); + /* net_get_name() will return one of the device names based on stable information about the + * device. If this is not available, we fall back to using the device name. */ name = net_get_name(device); if (!name) - return -ENOENT; + (void) sd_device_get_sysname(device, &name); + if (!name) + return log_device_debug_errno(device, SYNTHETIC_ERRNO(ENODATA), + "No stable identifying information found"); + log_device_debug(device, "Using \"%s\" as stable identifying information", name); l = strlen(name); sz = sizeof(sd_id128_t) + l; - v = alloca(sz); + v = newa(uint8_t, sz); - /* fetch some persistent data unique to this machine */ + /* Fetch some persistent data unique to this machine */ r = sd_id128_get_machine((sd_id128_t*) v); if (r < 0) return r;