]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/network/networkd-link.c
Merge pull request #14229 from yuwata/nspawn-network-interface-14223
[thirdparty/systemd.git] / src / network / networkd-link.c
index 990f62850a373d403bb6b22fde37e8ee5d13ab43..e650ef7e0a7260a795e62a22171199403d0f2b69 100644 (file)
@@ -36,6 +36,7 @@
 #include "qdisc.h"
 #include "set.h"
 #include "socket-util.h"
+#include "stat-util.h"
 #include "stdio-util.h"
 #include "string-table.h"
 #include "strv.h"
@@ -43,7 +44,6 @@
 #include "tmpfile-util.h"
 #include "udev-util.h"
 #include "util.h"
-#include "virt.h"
 #include "vrf.h"
 
 uint32_t link_get_vrf_table(Link *link) {
@@ -3292,8 +3292,8 @@ int link_add(Manager *m, sd_netlink_message *message, Link **ret) {
         if (r < 0)
                 return r;
 
-        if (detect_container() <= 0) {
-                /* not in a container, udev will be around */
+        if (path_is_read_only_fs("/sys") <= 0) {
+                /* udev should be around */
                 sprintf(ifindex_str, "n%d", link->ifindex);
                 r = sd_device_new_from_device_id(&device, ifindex_str);
                 if (r < 0) {
@@ -3303,7 +3303,7 @@ int link_add(Manager *m, sd_netlink_message *message, Link **ret) {
 
                 r = sd_device_get_is_initialized(device);
                 if (r < 0) {
-                        log_link_warning_errno(link, r, "Could not determine whether the device is initialized or not: %m");
+                        log_link_warning_errno(link, r, "Could not determine whether the device is initialized: %m");
                         goto failed;
                 }
                 if (r == 0) {
@@ -3314,11 +3314,11 @@ int link_add(Manager *m, sd_netlink_message *message, Link **ret) {
 
                 r = device_is_renaming(device);
                 if (r < 0) {
-                        log_link_warning_errno(link, r, "Failed to determine the device is renamed or not: %m");
+                        log_link_warning_errno(link, r, "Failed to determine the device is being renamed: %m");
                         goto failed;
                 }
                 if (r > 0) {
-                        log_link_debug(link, "Interface is under renaming, pending initialization.");
+                        log_link_debug(link, "Interface is being renamed, pending initialization.");
                         return 0;
                 }