Avoid dropping ctrl_iface on ENOBUFS error burst
authorJouni Malinen <jouni.malinen@atheros.com>
Sun, 11 Apr 2010 16:29:24 +0000 (19:29 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 11 Apr 2010 16:29:24 +0000 (19:29 +0300)
These bursts can result in control interface monitors being detached
even if the external program is still working properly. Use much larger
error threshold for ENOBUFS to avoid this.

wpa_supplicant/ctrl_iface_unix.c

index 9b596ba..84ac760 100644 (file)
@@ -525,7 +525,9 @@ static void wpa_supplicant_ctrl_iface_send(struct ctrl_iface_priv *priv,
                                           "%d - %s",
                                           idx, errno, strerror(errno));
                                dst->errors++;
-                               if (dst->errors > 10 || _errno == ENOENT) {
+                               if (dst->errors > 1000 ||
+                                   (_errno != ENOBUFS && dst->errors > 10) ||
+                                   _errno == ENOENT) {
                                        wpa_supplicant_ctrl_iface_detach(
                                                priv, &dst->addr,
                                                dst->addrlen);