[PATCH 1/2] hostapd: Add iface-name callback registration.

Ben Greear greearb
Fri Jan 14 09:54:39 PST 2011


This allows the interface name to be automatically
added to log file lines by the core logging logic.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
:100644 100644 b5471c2... 1194126... M	hostapd/main.c
 hostapd/main.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/hostapd/main.c b/hostapd/main.c
index b5471c2..1194126 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -476,6 +476,13 @@ static void usage(void)
 	exit(1);
 }
 
+static const char *hostapd_msg_ifname_cb(void *ctx)
+{
+	struct hostapd_data *hapd = ctx;
+	if (hapd && hapd->iconf && hapd->iconf->bss)
+		return hapd->iconf->bss->iface;
+	return "NULL";
+}
 
 int main(int argc, char *argv[])
 {
@@ -507,6 +514,7 @@ int main(int argc, char *argv[])
 #ifdef CONFIG_DEBUG_FILE
 		case 'f':
 			wpa_debug_open_file(optarg);
+			wpa_msg_register_ifname_cb(hostapd_msg_ifname_cb);
 			break;
 #endif
 		case 'K':
-- 
1.7.2.3




More information about the Hostap mailing list