You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dco_linux: ensure all client disconnects are processed
Under Linux DCO , netlink can return multiple messages in one call. The
receive calls in use call a callback once per message. Previously each
callback call would update flags on a global `dco` object. This was
based on two assumptions:
1. Only one code path would lead to a netlink receive call that would
result in finding out a client disconnected. This path was set to
handle the flags properly.
2. Each receive call would only trigger one callback that was setting
the single set of flags on that global object.
Both of these are false assumptions.
Any receive call to netlink (e.g. to get stats) can result in receiving
"unrelated" messages, like client disconnects. A previous patch at least
unified the callbacks to handle running the proper callback code, but
that doesn't resolve the issue that the stats gathering path does not
have the code to handle a client disconnect.
Multiple messages can be processed in a single receive call, so if two
or more devices disconnect then a single read call will result in only
the last of the messages setting flags (overwriting the other callback
values set previously) and only that device is processed for
disconnection in user space.
This patch resolves both by handling the disconnect logic directly in
the netlink callback rather than setting flags and handling it later.
0 commit comments