mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 09:40:17 +01:00
netlink: work around kernel cache refill problems
Sometimes cause the cache not to refill with all interfaces, meaning NM sometimes got the wrong carrier state from the kernel which prevented NM from taking over existing connections.
This commit is contained in:
parent
534509b3c7
commit
d41c35fbf8
1 changed files with 13 additions and 0 deletions
|
|
@ -560,6 +560,19 @@ nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *self,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/* HACK: Apparently to get it working we have to refill the cache twice;
|
||||
* otherwise some kernels (or maybe libnl?) only send a few of the
|
||||
* interfaces in the refill request.
|
||||
*/
|
||||
if (nl_cache_refill (priv->nlh, priv->nlh_link_cache)) {
|
||||
g_set_error (error,
|
||||
NM_NETLINK_MONITOR_ERROR,
|
||||
NM_NETLINK_MONITOR_ERROR_LINK_CACHE_UPDATE,
|
||||
_("error updating link cache: %s"),
|
||||
nl_geterror ());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Set up the filter */
|
||||
filter = rtnl_link_alloc ();
|
||||
if (!filter) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue