summaryrefslogtreecommitdiffstats
path: root/usr.sbin/wpa
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2005-06-09 22:19:00 +0000
committersam <sam@FreeBSD.org>2005-06-09 22:19:00 +0000
commit7a16f375cc9af23759563f66f0ac975df581d877 (patch)
tree0969f876fd65847b5dc6cbb0365947977ccd18a1 /usr.sbin/wpa
parent4fa0803f2495124103bce06dabee155eb91bfc32 (diff)
downloadFreeBSD-src-7a16f375cc9af23759563f66f0ac975df581d877.zip
FreeBSD-src-7a16f375cc9af23759563f66f0ac975df581d877.tar.gz
o improve error msg for ioctl failures
o zero mlme struct before use
Diffstat (limited to 'usr.sbin/wpa')
-rw-r--r--usr.sbin/wpa/wpa_supplicant/driver_freebsd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c b/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c
index 860d8cb..b943e14 100644
--- a/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c
+++ b/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c
@@ -54,7 +54,8 @@ set80211var(struct wpa_driver_bsd_data *drv, int op, const void *arg, int arg_le
ireq.i_data = (void *) arg;
if (ioctl(drv->sock, SIOCS80211, &ireq) < 0) {
- perror("ioctl[SIOCS80211]");
+ fprintf(stderr, "ioctl[SIOCS80211, op %u, len %u]: %s\n",
+ op, arg_len, strerror(errno));
return -1;
}
return 0;
@@ -90,6 +91,8 @@ set80211param(struct wpa_driver_bsd_data *drv, int op, int arg)
if (ioctl(drv->sock, SIOCS80211, &ireq) < 0) {
perror("ioctl[SIOCS80211]");
+ fprintf(stderr, "ioctl[SIOCS80211, op %u, arg 0x%x]: %s\n",
+ op, arg, strerror(errno));
return -1;
}
return 0;
@@ -293,6 +296,7 @@ wpa_driver_bsd_deauthenticate(void *priv, const u8 *addr, int reason_code)
struct ieee80211req_mlme mlme;
wpa_printf(MSG_DEBUG, "%s", __func__);
+ memset(&mlme, 0, sizeof(mlme));
mlme.im_op = IEEE80211_MLME_DEAUTH;
mlme.im_reason = reason_code;
memcpy(mlme.im_macaddr, addr, IEEE80211_ADDR_LEN);
@@ -306,6 +310,7 @@ wpa_driver_bsd_disassociate(void *priv, const u8 *addr, int reason_code)
struct ieee80211req_mlme mlme;
wpa_printf(MSG_DEBUG, "%s", __func__);
+ memset(&mlme, 0, sizeof(mlme));
mlme.im_op = IEEE80211_MLME_DISASSOC;
mlme.im_reason = reason_code;
memcpy(mlme.im_macaddr, addr, IEEE80211_ADDR_LEN);
OpenPOWER on IntegriCloud