diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/network/networkd-link.c | 5 | ||||
-rw-r--r-- | src/network/networkd-manager.c | 8 | ||||
-rw-r--r-- | src/network/networkd.h | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 22864bd403..077626cd17 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1492,7 +1492,10 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use } else { r = link_get(m, ifindex, &link); if (r < 0 || !link) { - log_warning("rtnl: received address for nonexistent link (%d), ignoring", ifindex); + /* when enumerating we might be out of sync, but we will + * get the address again, so just ignore it */ + if (!m->enumerating) + log_warning("rtnl: received address for nonexistent link (%d), ignoring", ifindex); return 0; } } diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index 378633061e..4d27272b3b 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -525,9 +525,13 @@ int manager_rtnl_enumerate_links(Manager *m) { for (link = reply; link; link = sd_rtnl_message_next(link)) { int k; + m->enumerating = true; + k = manager_rtnl_process_link(m->rtnl, link, m); if (k < 0) r = k; + + m->enumerating = false; } return r; @@ -556,9 +560,13 @@ int manager_rtnl_enumerate_addresses(Manager *m) { for (addr = reply; addr; addr = sd_rtnl_message_next(addr)) { int k; + m->enumerating = true; + k = link_rtnl_process_address(m->rtnl, addr, m); if (k < 0) r = k; + + m->enumerating = false; } return r; diff --git a/src/network/networkd.h b/src/network/networkd.h index 075aefec71..e053bd624a 100644 --- a/src/network/networkd.h +++ b/src/network/networkd.h @@ -206,6 +206,8 @@ struct Manager { struct udev_monitor *udev_monitor; sd_event_source *udev_event_source; + bool enumerating; + char *state_file; Hashmap *links; |