]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Allow DATA_TEST_CONFIG to configure ifname
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 27 Nov 2014 12:02:18 +0000 (14:02 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 27 Nov 2014 12:02:18 +0000 (14:02 +0200)
This allows the device-based data connectivity tests to be extended for
bridge and VLAN interface cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
hostapd/ctrl_iface.c

index fa0e81fa04ba7cb3453af2a8a7d87ac04194d41a..33cb8bc34bea3ef020ae7910739144e73d9ce8dd 100644 (file)
@@ -1543,6 +1543,8 @@ static int hostapd_ctrl_iface_data_test_config(struct hostapd_data *hapd,
                                               char *cmd)
 {
        int enabled = atoi(cmd);
+       char *pos;
+       const char *ifname;
 
        if (!enabled) {
                if (hapd->l2_test) {
@@ -1557,7 +1559,13 @@ static int hostapd_ctrl_iface_data_test_config(struct hostapd_data *hapd,
        if (hapd->l2_test)
                return 0;
 
-       hapd->l2_test = l2_packet_init(hapd->conf->iface, hapd->own_addr,
+       pos = os_strstr(cmd, " ifname=");
+       if (pos)
+               ifname = pos + 8;
+       else
+               ifname = hapd->conf->iface;
+
+       hapd->l2_test = l2_packet_init(ifname, hapd->own_addr,
                                        ETHERTYPE_IP, hostapd_data_test_rx,
                                        hapd, 1);
        if (hapd->l2_test == NULL)