If we get a NEWLINK + NEWADDR between enumerating the links and enumerating the addresses, we
would get a warning that the link corresponding to the address does not exist. This is a false
warning as both the NEWLINK and NEWADDR would be processed after enumerating completed, so drop
it.
} 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;
}
}
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;
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;
struct udev_monitor *udev_monitor;
sd_event_source *udev_event_source;
+ bool enumerating;
+
char *state_file;
Hashmap *links;