wpa_cli: Do not pick p2p-dev-* interfaces by default
These are the driver-specific interface for the non-netdev P2P Device interface and not something that useful for most use cases. Skip them to allow the main netdev (e.g., wlan0 over p2p-dev-wlan0) to be selected. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
b3ba2556e7
commit
a69742c2f8
1 changed files with 4 additions and 1 deletions
|
@ -4606,8 +4606,11 @@ static char * wpa_cli_get_default_ifname(void)
|
||||||
if (dent->d_type != DT_SOCK && dent->d_type != DT_UNKNOWN)
|
if (dent->d_type != DT_SOCK && dent->d_type != DT_UNKNOWN)
|
||||||
continue;
|
continue;
|
||||||
#endif /* _DIRENT_HAVE_D_TYPE */
|
#endif /* _DIRENT_HAVE_D_TYPE */
|
||||||
|
/* Skip current/previous directory and special P2P Device
|
||||||
|
* interfaces. */
|
||||||
if (os_strcmp(dent->d_name, ".") == 0 ||
|
if (os_strcmp(dent->d_name, ".") == 0 ||
|
||||||
os_strcmp(dent->d_name, "..") == 0)
|
os_strcmp(dent->d_name, "..") == 0 ||
|
||||||
|
os_strncmp(dent->d_name, "p2p-dev-", 8) == 0)
|
||||||
continue;
|
continue;
|
||||||
printf("Selected interface '%s'\n", dent->d_name);
|
printf("Selected interface '%s'\n", dent->d_name);
|
||||||
ifname = os_strdup(dent->d_name);
|
ifname = os_strdup(dent->d_name);
|
||||||
|
|
Loading…
Reference in a new issue