Browse Source

Avoid dropping ctrl_iface on ENOBUFS error burst

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.
Jouni Malinen 15 years ago
parent
commit
6700a277a9
1 changed files with 3 additions and 1 deletions
  1. 3 1
      wpa_supplicant/ctrl_iface_unix.c

+ 3 - 1
wpa_supplicant/ctrl_iface_unix.c

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