]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Add iface-name wpa_msg() callback registration
authorBen Greear <greearb@candelatech.com>
Sun, 6 Feb 2011 18:50:32 +0000 (20:50 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 6 Feb 2011 18:50:32 +0000 (20:50 +0200)
This allows the interface name to be automatically
added to log file lines by the core logging logic.

Signed-off-by: Ben Greear <greearb@candelatech.com>
hostapd/main.c

index 45836df8dc37a9282c9cc1aca604e2a057a5da1c..b03fdd8c4a146b83c12f079a3eb75a8d9143da28 100644 (file)
@@ -477,6 +477,15 @@ static void usage(void)
 }
 
 
+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[])
 {
        struct hapd_interfaces interfaces;
@@ -532,6 +541,8 @@ int main(int argc, char *argv[])
        if (optind == argc)
                usage();
 
+       wpa_msg_register_ifname_cb(hostapd_msg_ifname_cb);
+
        if (log_file)
                wpa_debug_open_file(log_file);