udev/net: do not manage loopback interfaces

There are nothing we can configure in udevd for loopback interfaces;
no ethertool configs can be applied, MAC address, interface name should
not be touched.
This commit is contained in:
Yu Watanabe
2021-05-23 22:58:47 +09:00
parent f25e642bca
commit 70f32a260b
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -243,6 +243,7 @@ int link_config_get(LinkConfigContext *ctx, sd_device *device, LinkConfig **ret)
unsigned short iftype;
LinkConfig *link;
const char *name;
unsigned flags;
int ifindex, r;
assert(ctx);
@@ -257,10 +258,14 @@ int link_config_get(LinkConfigContext *ctx, sd_device *device, LinkConfig **ret)
if (r < 0)
return r;
r = rtnl_get_link_info(&ctx->rtnl, ifindex, &iftype, NULL);
r = rtnl_get_link_info(&ctx->rtnl, ifindex, &iftype, &flags);
if (r < 0)
return r;
/* Do not configure loopback interfaces by .link files. */
if (flags & IFF_LOOPBACK)
return -ENOENT;
r = ethtool_get_permanent_macaddr(&ctx->ethtool_fd, name, &permanent_mac);
if (r < 0)
log_device_debug_errno(device, r, "Failed to get permanent MAC address, ignoring: %m");