X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fudev%2Fnet%2Flink-config.c;h=fe916a4326755e7fc0be49d2c89d77db6e831533;hp=7a9d01bc184df118d0cf76fa9eb66395406d1f58;hb=e9f3d2d508bfd9fb5b54e82994bda365a71eb864;hpb=f8a0bb5285024b6ce372c3157e761e6543ebdcd2 diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 7a9d01bc1..fe916a432 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -92,14 +92,20 @@ static int link_config_ctx_connect(link_config_ctx *ctx) { if (ctx->ethtool_fd == -1) { r = ethtool_connect(&ctx->ethtool_fd); - if (r < 0) + if (r < 0) { + log_warning("link_config: could not connect to ethtool: %s", + strerror(-r)); return r; + } } if (!ctx->rtnl) { r = sd_rtnl_open(&ctx->rtnl, 0); - if (r < 0) + if (r < 0) { + log_warning("link_config: could not connect to rtnl: %s", + strerror(-r)); return r; + } } return 0; @@ -168,8 +174,10 @@ static int load_link(link_config_ctx *ctx, const char *filename) { link->wol = _WOL_INVALID; link->duplex = _DUP_INVALID; - r = config_parse(NULL, filename, file, "Match\0Link\0Ethernet\0", config_item_perf_lookup, - (void*) link_config_gperf_lookup, false, false, link); + r = config_parse(NULL, filename, file, + "Match\0Link\0Ethernet\0", + config_item_perf_lookup, link_config_gperf_lookup, + false, false, link); if (r < 0) { log_warning("Could not parse config file %s: %s", filename, strerror(-r)); return r; @@ -377,7 +385,9 @@ int link_config_apply(link_config_ctx *ctx, link_config *config, struct udev_dev case MACPOLICY_PERSISTENT: if (mac_is_random(device)) { r = get_mac(device, false, &generated_mac); - if (r < 0) + if (r == -ENOENT) + break; + else if (r < 0) return r; mac = &generated_mac; } @@ -385,7 +395,9 @@ int link_config_apply(link_config_ctx *ctx, link_config *config, struct udev_dev case MACPOLICY_RANDOM: if (!mac_is_random(device)) { r = get_mac(device, true, &generated_mac); - if (r < 0) + if (r == -ENOENT) + break; + else if (r < 0) return r; mac = &generated_mac; }