Changeset 2237


Ignore:
Timestamp:
Dec 13, 2012, 7:23:32 PM (6 years ago)
Author:
matthijs
Message:

ap_client: include the correct ssid in active scans

Previously, ap_client would pass SiteSurvey?=1 to the driver, causing it
run an active scan with the SSID set to "1".

Now, ap_client passes the actual ssid it is connecting to to the driver,
causing it to send out a probe request to the actual SSID. This allows
ap_client to connect to hidden SSIDs as well.

When using ap_client to only scan, without a connection attempt, no SSID
is passed to the driver, which does a passive scan instead (i.e., no
probe request is sent).

Closes: #1138

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/fon/ap_client/src/ap_client.c

    r2189 r2237  
    111111
    112112#define RTPRIV_IOCTL_GSITESURVEY (SIOCIWFIRSTPRIV + 0x0D)
    113 void wifi_site_survey(const char *ifname, int print)
     113void wifi_site_survey(const char *ifname, char* essid, int print)
    114114{
    115115        char *s = malloc(IW_SCAN_MAX_DATA);
     
    118118        struct iwreq wrq;
    119119        char *line, *start;
    120         iwpriv(ifname, "SiteSurvey", "1");
     120        iwpriv(ifname, "SiteSurvey", (essid ? essid : ""));
    121121        sleep(5);
    122122        memset(s, 0x00, IW_SCAN_MAX_DATA);
     
    274274                        syslog(LOG_INFO, "%s is not associated\n", APCLI_IFNAME);
    275275                        syslog(LOG_INFO, "Scanning for networks...\n");
    276                         wifi_site_survey(ifname, 0);
     276                        wifi_site_survey(ifname, essid, 0);
    277277                        c = wifi_find_ap(essid);
    278278                        try_count++;
     
    325325        openlog("ap_client", 0, 0);
    326326        if(argc == 1)
    327                 wifi_site_survey(AP_IFNAME, 1);
     327                wifi_site_survey(AP_IFNAME, NULL, 1);
    328328        else if(argc == 3)
    329329                assoc_loop(AP_IFNAME, argv[1], argv[2]);
Note: See TracChangeset for help on using the changeset viewer.