[PATCH 3/4] hostapd: Convert some wpa_printf to wpa_msg/dbg

greearb at candelatech.com greearb at candelatech.com
Mon Oct 24 15:09:38 EDT 2011


From: Ben Greear <greearb at candelatech.com>

This generates better log messages when running multiple
interfaces in one process.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
:100644 100644 4a6e011... 99e4ef7... M	hostapd/ctrl_iface.c
:100644 100644 23c8b1a... 9978a85... M	src/ap/hostapd.c
:100644 100644 63598e9... af535d8... M	src/ap/ieee802_1x.c
 hostapd/ctrl_iface.c |   10 +++++-----
 src/ap/hostapd.c     |    6 +++---
 src/ap/ieee802_1x.c  |    4 ++--
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 4a6e011..99e4ef7 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -174,9 +174,9 @@ static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
 	if (mgmt == NULL)
 		return -1;
 
-	wpa_printf(MSG_DEBUG, "P2P: Disconnect STA " MACSTR " with minor "
-		   "reason code %u (stype=%u)",
-		   MAC2STR(addr), minor_reason_code, stype);
+	wpa_dbg(hapd, MSG_DEBUG, "P2P: Disconnect STA " MACSTR " with minor "
+		"reason code %u (stype=%u)",
+		MAC2STR(addr), minor_reason_code, stype);
 
 	mgmt->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT, stype);
 	os_memcpy(mgmt->da, addr, ETH_ALEN);
@@ -219,7 +219,7 @@ static int hostapd_ctrl_iface_deauthenticate(struct hostapd_data *hapd,
 	struct sta_info *sta;
 	const char *pos;
 
-	wpa_printf(MSG_DEBUG, "CTRL_IFACE DEAUTHENTICATE %s", txtaddr);
+	wpa_dbg(hapd, MSG_DEBUG, "CTRL_IFACE DEAUTHENTICATE %s", txtaddr);
 
 	if (hwaddr_aton(txtaddr, addr))
 		return -1;
@@ -275,7 +275,7 @@ static int hostapd_ctrl_iface_disassociate(struct hostapd_data *hapd,
 	struct sta_info *sta;
 	const char *pos;
 
-	wpa_printf(MSG_DEBUG, "CTRL_IFACE DISASSOCIATE %s", txtaddr);
+	wpa_dbg(hapd, MSG_DEBUG, "CTRL_IFACE DISASSOCIATE %s", txtaddr);
 
 	if (hwaddr_aton(txtaddr, addr))
 		return -1;
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 23c8b1a..9978a85 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -345,12 +345,12 @@ static int hostapd_flush_old_stations(struct hostapd_data *hapd)
 	if (hostapd_drv_none(hapd) || hapd->drv_priv == NULL)
 		return 0;
 
-	wpa_printf(MSG_DEBUG, "Flushing old station entries");
+	wpa_dbg(hapd, MSG_DEBUG, "Flushing old station entries");
 	if (hostapd_flush(hapd)) {
-		wpa_printf(MSG_WARNING, "Could not connect to kernel driver.");
+		wpa_msg(hapd, MSG_WARNING, "Could not connect to kernel driver.");
 		ret = -1;
 	}
-	wpa_printf(MSG_DEBUG, "Deauthenticate all stations");
+	wpa_dbg(hapd, MSG_DEBUG, "Deauthenticate all stations");
 	os_memset(addr, 0xff, ETH_ALEN);
 	hostapd_drv_sta_deauth(hapd, addr, WLAN_REASON_PREV_AUTH_NOT_VALID);
 	hostapd_free_stas(hapd);
diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c
index 63598e9..af535d8 100644
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -2092,8 +2092,8 @@ static void ieee802_1x_finished(struct hostapd_data *hapd,
 		 * EAP-FAST with anonymous provisioning, may require another
 		 * EAPOL authentication to be started to complete connection.
 		 */
-		wpa_printf(MSG_DEBUG, "IEEE 802.1X: Force disconnection after "
-			   "EAP-Failure");
+		wpa_dbg(hapd, MSG_DEBUG, "IEEE 802.1X: Force disconnection after "
+			"EAP-Failure");
 		/* Add a small sleep to increase likelihood of previously
 		 * requested EAP-Failure TX getting out before this should the
 		 * driver reorder operations.
-- 
1.7.3.4



More information about the HostAP mailing list