CHROMIUMOS: hostapd: Prevent duplicate destination control interface sockets.

Occasionally, when a client, connected to the control interface socket,
crashes, the destination socket information does not get cleaned up
properly. If the client is quickly restarted using the same unix
domain socket, hostapd can end up with two entries in its destinations
list pointed at the same destination. In extreme cases more than 1000
entries to the same destination have been observed. This change
prevents multiple entries in the list with the same destination.

BUG=b:27447539
TEST=With extra instrumentation in hostapd, repeatedly stopped/restarted a
process that creates a hostapd control interface socket at the same
destination.  Verified that the condition was triggered and that
duplicate messages were not sent to the connecting process.

Change-Id: I17f07e108fb0698dc877dad44df326578a44cb84
Reviewed-on: https://chromium-review.googlesource.com/333003
Commit-Ready: John Walker <walker@google.com>
Tested-by: John Walker <walker@google.com>
Reviewed-by: Grant Grundler <grundler@chromium.org>
1 file changed