Skip to content
  • Thomas Haller's avatar
    platform: fetch objects via the event socket · 051cf8bb
    Thomas Haller authored
    Use the event socket to request object via NLM_F_DUMP.
    
    No longer use 'priv->nlh' socket to fetch objects.
    Instead fetch them via the priv->nlh_event socket that also
    provides asynchronous events when objects change.
    
    That way, the events are in sync with our explicit requests
    and we can directly use the events. Previously, the events were
    only used to indicate that a refetch must happen, so that every
    event triggered a complete dump of all addresses/routes.
    
    We still use 'priv->nlh' to make synchronous requests such as
    adding/changing/deleting objects. That means, after we send a
    request, we must make sure that the result manifested itself
    at 'nlh_event' socket and the platform cache.
    That's why we sometimes still must force a dump to sync changes.
    That could be improved by using only one netlink socket so that
    we would wait for the ACK of our request.
    
    While not yet perfect, this already significantly reduces the number of
    fetches. Additionally, before, whenever requesting a dump of addresses
    or routes (which we did much more often, search for "get_kernel_object for type"
    log lines), we always dumped IPv4 and IPv6 together. Now only request
    the addr-family in question.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747985
    https://bugzilla.redhat.com/show_bug.cgi?id=1211133
    051cf8bb