diff options
author | Antonio Rojas | 2019-04-03 06:42:04 +0000 |
---|---|---|
committer | Antonio Rojas | 2019-04-03 06:42:04 +0000 |
commit | 3d0b90df3241b9e89000d4d0b2effebd58b0f5a2 (patch) | |
tree | 44f297eae2110fdde84de943a8dcdf98db73fe7d | |
download | aur-3d0b90df3241b9e89000d4d0b2effebd58b0f5a2.tar.gz |
Dropped from repos
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | 0001-wpa_actiond-Wait-for-three-failed-PONGs-before-disco.patch | 72 | ||||
-rw-r--r-- | PKGBUILD | 33 |
3 files changed, 124 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..05c660e82c37 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = wpa_actiond + pkgdesc = Daemon that connects to wpa_supplicant and handles connect and disconnect events + pkgver = 1.4 + pkgrel = 3 + url = http://projects.archlinux.org/wpa_actiond.git/ + arch = x86_64 + license = GPL + depends = glibc + depends = wpa_supplicant + source = https://sources.archlinux.org/other/wpa_actiond/wpa_actiond-1.4.tar.xz + source = https://sources.archlinux.org/other/wpa_actiond/wpa_actiond-1.4.tar.xz.sig + source = 0001-wpa_actiond-Wait-for-three-failed-PONGs-before-disco.patch + validpgpkeys = A314827C4E4250A204CE6E13284FC34C8E4B1A25 + sha256sums = e0e65e7c52a32796a0ff855ab18aa0b237d6b9afc87d4008c0380735abcb1a54 + sha256sums = SKIP + sha256sums = b318ad3c2dcc65e204dfb5d21a034712fbbb801b062442869420bdf8a0060856 + +pkgname = wpa_actiond + diff --git a/0001-wpa_actiond-Wait-for-three-failed-PONGs-before-disco.patch b/0001-wpa_actiond-Wait-for-three-failed-PONGs-before-disco.patch new file mode 100644 index 000000000000..3e0f22b68ad3 --- /dev/null +++ b/0001-wpa_actiond-Wait-for-three-failed-PONGs-before-disco.patch @@ -0,0 +1,72 @@ +From 8b74c8b3f69e501560e5f0c25cbcbc4aefcbc0ed Mon Sep 17 00:00:00 2001 +From: Emil Velikov <emil.l.velikov@gmail.com> +Date: Mon, 21 Aug 2017 11:34:00 +0200 +Subject: [PATCH] wpa_actiond: Wait for three "failed" PONGs before + disconnecting + +When the system is very low on resources, select() may return 0 even +when wpa_supplicant is alive and kicking. + +Don't disconnect as soon at that occurs - wait three times and clearly +log it. + +Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> +--- + wpa_actiond.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/wpa_actiond.c b/wpa_actiond.c +index d60d885..03a9d7f 100644 +--- a/wpa_actiond.c ++++ b/wpa_actiond.c +@@ -292,6 +292,7 @@ static void loop(const char *iface, const char *ctrlpath, const int disconnect_t + /* path to control socket */ + char *ctrlsock = NULL; + int ctrlsocklen; ++ int pong_failures = 0; + + ssid[0] = '\0'; + old_ssid[0] = '\0'; +@@ -359,6 +360,7 @@ static void loop(const char *iface, const char *ctrlpath, const int disconnect_t + } + logevent(WPA_ACTIOND_LOG_TERMINATE, iface, ""); + state = WPA_ACTIOND_STATE_TERMINATED; ++ pong_failures = 0; + break; + case 0: + if (state == WPA_ACTIOND_STATE_CONNECTION_LOST) { +@@ -372,8 +374,15 @@ static void loop(const char *iface, const char *ctrlpath, const int disconnect_t + reply_len = 0; + reply[reply_len] = '\0'; + if(!str_match(reply, "PONG")) { ++ if (pong_failures <= 3) { ++ logevent(WPA_ACTIOND_LOG_CUSTOM_ERROR, iface, "wpa_supplicant failed to reply (PONG)"); ++ pong_failures++; ++ break; ++ } ++ + /* supplicant has been terminated */ + if(state == WPA_ACTIOND_STATE_CONNECTED || state == WPA_ACTIOND_STATE_CONNECTION_LOST) { ++ logevent(WPA_ACTIOND_LOG_CUSTOM_ERROR, iface, "wpa_supplicant failed to reply three times in a row - disconnecting"); + logevent(WPA_ACTIOND_LOG_DISCONNECTED, iface, ssid); + action(WPA_ACTIOND_ACTION_DISCONNECT, iface, ssid, idstr, wpa_ctrl_get_fd(ctrl), script); + } +@@ -381,6 +390,7 @@ static void loop(const char *iface, const char *ctrlpath, const int disconnect_t + state = WPA_ACTIOND_STATE_TERMINATED; + } + } ++ pong_failures = 0; + break; + default: + /* event received */ +@@ -446,6 +456,7 @@ static void loop(const char *iface, const char *ctrlpath, const int disconnect_t + /* we are not interested in this event */ + break; + } ++ pong_failures = 0; + } + } + +-- +2.15.0 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..9e456111d6ba --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,33 @@ +# Maintainer: Thomas Bächler <thomas@archlinux.org> +pkgname=wpa_actiond +pkgver=1.4 +pkgrel=3 +pkgdesc="Daemon that connects to wpa_supplicant and handles connect and disconnect events" +arch=('x86_64') +url="http://projects.archlinux.org/wpa_actiond.git/" +license=('GPL') +depends=('glibc' 'wpa_supplicant') +source=(https://sources.archlinux.org/other/wpa_actiond/${pkgname}-${pkgver}.tar.xz + https://sources.archlinux.org/other/wpa_actiond/${pkgname}-${pkgver}.tar.xz.sig + 0001-wpa_actiond-Wait-for-three-failed-PONGs-before-disco.patch) +sha256sums=('e0e65e7c52a32796a0ff855ab18aa0b237d6b9afc87d4008c0380735abcb1a54' + 'SKIP' + 'b318ad3c2dcc65e204dfb5d21a034712fbbb801b062442869420bdf8a0060856') +validpgpkeys=('A314827C4E4250A204CE6E13284FC34C8E4B1A25') # Thomas Bächler + +prepare() { + cd "${srcdir}/${pkgname}-${pkgver}" + patch -p1 -i "${srcdir}/0001-wpa_actiond-Wait-for-three-failed-PONGs-before-disco.patch" +} + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + make CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + + install -D -m755 wpa_actiond "${pkgdir}/usr/bin/wpa_actiond" +} +# vim:set ts=2 sw=2 et: |