aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/wpa_ctrl.c
Commit message (Collapse)AuthorAgeFilesLines
* wpa_ctrl: Retry select() on EINTRJörg Krause2016-02-071-0/+2
| | | | | | Retry select() if it was interrupted by a signal. Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
* Android: Set ctrl_iface client socket group (AID_WIFI) separatelyAmarnath Hullur Subramanyam2015-09-241-0/+2
| | | | | | | | | | Split chown() call in wpa_ctrl_open() and wpa_ctrl_open2() to allow the group id to be set even if the process does not have privileges to change the owner. This is needed for modules that need to communicate with wpa_supplicant since without the group change, wpa_supplicant may not have privileges to send the response to a control interface command. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Allow wpa_cli/hostapd_cli client socket directory to be specifiedManikandan Mohan2015-09-011-4/+19
| | | | | | | | | This adds a new helper function wpa_ctrl_open2() that can be used instead of wpa_ctrl_open() to override the default client socket directory. Add optional -s<directory path> argument to hostapd_cli and wpa_cli to allow the client socket directory to be specified. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Android: wpa_ctrl missing include for sys/stat.hMark Salyzyn2015-04-031-0/+1
| | | | | | | | | | | wpa_ctrl.c gets sys/stat.h inherited from private/android_filesystem_config.h it should not rely on this in the future. The intent is to move fs_config function into libcutils and thus deprecate any need for sys/stat.h in this include file. Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* Check os_snprintf() result more consistently - manualJouni Malinen2014-12-081-1/+1
| | | | | | | | This converts os_snprintf() result validation cases to use os_snprintf_error() for cases that were note covered by spatch and semantic patches. Signed-off-by: Jouni Malinen <j@w1.fi>
* Check os_snprintf() result more consistently - automatic 1Jouni Malinen2014-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts os_snprintf() result validation cases to use os_snprintf_error() where the exact rule used in os_snprintf_error() was used. These changes were done automatically with spatch using the following semantic patch: @@ identifier E1; expression E2,E3,E4,E5,E6; statement S1; @@ ( E1 = os_snprintf(E2, E3, ...); | int E1 = os_snprintf(E2, E3, ...); | if (E5) E1 = os_snprintf(E2, E3, ...); else E1 = os_snprintf(E2, E3, ...); | if (E5) E1 = os_snprintf(E2, E3, ...); else if (E6) E1 = os_snprintf(E2, E3, ...); else E1 = 0; | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else { ... return -1; } | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else if (E6) { ... E1 = os_snprintf(E2, E3, ...); } else { ... return -1; } | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else { ... E1 = os_snprintf(E2, E3, ...); } ) ? os_free(E4); - if (E1 < 0 || \( E1 >= E3 \| (size_t) E1 >= E3 \| (unsigned int) E1 >= E3 \| E1 >= (int) E3 \)) + if (os_snprintf_error(E3, E1)) ( S1 | { ... } ) Signed-off-by: Jouni Malinen <j@w1.fi>
* Use os_zalloc() instead of os_malloc() and os_memset()Jouni Malinen2014-12-081-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Automatically updated with spatch and the following semantic patch: @@ expression X; expression E1; statement S; @@ - X = os_malloc(E1); + X = os_zalloc(E1); ( if (X == NULL) { ... } - os_memset(X, 0, E1); | if (X == NULL) S - os_memset(X, 0, E1); ) Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_supplicant: Add support for IPv6 with UDP ctrl_ifaceJanusz Dziedzic2014-02-251-3/+66
| | | | | | | | | | | | | | | | | | | | Add IPv6 support when using udp/udp-remote control interface using the following new build configuration options: CONFIG_CTRL_IFACE=udp6 CONFIG_CTRL_IFACE=udp6-remote This is useful for testing, while we don't need to assign IPv4 address (static or using DHCP) and can just use auto configured IPv6 addresses (link local, which is based on the MAC address). Also add scope id support for link local case. For example, ./wpa_cli ./wpa_cli -i ::1,9877 ./wpa_cli -i fe80::203:7fff:fe05:69%wlan0,9877 Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
* wpa_ctrl: Use monotonic time for request retry loopJohannes Berg2013-12-241-5/+5
| | | | | | | | The request retry loop only retries for 5 seconds, so any time jumps would probably not affect it much, but it should be using monotonic time nonetheless since it only cares about duration. Signed-hostap: Johannes Berg <johannes.berg@intel.com>
* Android: Clean entire socket directoryDmitry Shmidt2013-11-221-6/+2
| | | | | | | Despite interface (and group) related sockets are not used for control, they are created and may be left. Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* Abstract and Android sockets for global ctrl_ifaceJouni Malinen2013-05-181-7/+30
| | | | | | | | | The wpa_supplicant global control interface parameter can now be used to explicitly specify an abstract UNIX domain socket (Linux specific extension) with "@abstract:" prefix and an Android control socket with "@android:" prefix. Signed-hostap: Jouni Malinen <j@w1.fi>
* wpa_cli: Print nice prompt when using remote UDPJanusz Dziedzic2012-08-051-1/+24
| | | | | | | | | When CONFIG_CTRL_IFACE=udp-remote is used, print user frendly PS in wpa_cli. E.g., localhost/wlan0> 192.168.1.1/p2p-wlan-0-0> Signed-hostap: Janusz Dziedzic <janusz.dziedzic@tieto.com>
* wpa_cli: Add support for remote accessJanusz Dziedzic2012-08-051-0/+44
| | | | | | | | | | | wpa_cli can be used now as a client for remote access to ctrl_interface of wpa_supplicant when UDP and remote options are used. You can simply run: wpa_cli -i <hostname>:[port] wpa_cli -i <IP>:[port] Signed-hostap: Janusz Dziedzic <janusz.dziedzic@tieto.com>
* Make UNIX socket non-blocking for ctrl_ifaceBen Greear2012-08-041-0/+40
| | | | | | | This keeps wpa_cli from hanging forever if the other end of the socket dies. Signed-hostap: Ben Greear <greearb@candelatech.com>
* Remove the GPL notification from files contributed by Jouni MalinenJouni Malinen2012-02-111-8/+2
| | | | | | | Remove the GPL notification text from the files that were initially contributed by myself. Signed-hostap: Jouni Malinen <j@w1.fi>
* Android: Add wpa_ctrl_cleanup()Dmitry Shmidt2011-10-181-0/+51
| | | | | | | This function can be used to clean up local UNIX domain socket files that may be left over from clients that were previously connected to wpa_supplicant. At least for now, this is only available for Android builds.
* Check select() return value in wpa_ctrl_request()Dmitry Shmidt2011-03-151-0/+2
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* Allow client control socket location to be overriddenJouni Malinen2011-02-271-1/+11
| | | | | | | | Build options can now be used to replace the location of client sockets for UNIX domain socket control interface: CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/tmp\" CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_PREFIX=\"wpa_ctrl_\"
* Use Android reserved namespace for control interfaceDmitry Shmidt2011-02-271-0/+30
| | | | | On Android, use a special reserved namespace for the UNIX domain socket.
* Use longer timeout in wpa_ctrl_request()Dmitry Shmidt2011-02-271-1/+1
| | | | | Wait longer for control interface response from wpa_supplicant to avoid issues with some drivers that have long blocking operations.
* Make wpa_ctrl_close() handle unopened connectionDmitry Shmidt2011-02-271-1/+4
|
* Solaris: Add support for wired IEEE 802.1X clientMasashi Honma2010-08-281-1/+1
| | | | | | | | | This patch adds support for wired IEEE 802.1X client on the Solaris. I have tested with these: OS : OpenSolaris 2009.06 EAP : EAP-MD5 Switch : Cisco Catalyst 2950
* Remove orphaned wpa_cli control socket on EADDRINUSEJouni Malinen2009-01-311-1/+15
| | | | | | | | | If the bind() on /tmp/wpa_ctrl_<pid>_<in-proc-counter> fails with EADDRINUSE, there is an existing socket file with the name we are trying to create. Since getpid() is unique, there cannot be another process using that socket and we can just unlink the file and try again. This can speed up client connection if wpa_cli is killed without allowing it to clean up the socket file. [Bug 288]
* Re-initialize hostapd/wpa_supplicant git repository based on 0.6.3 releaseJouni Malinen2008-02-281-0/+441