ifconfig & Network preferences: Actually trigger scans using BNetworkDevice.
Fixes #12034, and a variety of other strange "no wireless networks appear" bugs that have plagued Haiku for years. Change-Id: I734cb8084e8a626b8e03511519609bf80c1559eb Reviewed-on: https://review.haiku-os.org/552 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
4e5aaaa700
commit
45bc01d2f7
@@ -281,6 +281,7 @@ configure_wireless(const char* name, char* const* args, int32 argCount)
|
||||
{
|
||||
enum {
|
||||
NONE,
|
||||
SCAN,
|
||||
LIST,
|
||||
JOIN,
|
||||
LEAVE,
|
||||
@@ -290,7 +291,9 @@ configure_wireless(const char* name, char* const* args, int32 argCount)
|
||||
int controlOption = -1;
|
||||
int controlValue = -1;
|
||||
|
||||
if (!strcmp(args[0], "list") || !strcmp(args[0], "scan"))
|
||||
if (!strcmp(args[0], "scan"))
|
||||
mode = SCAN;
|
||||
else if (!strcmp(args[0], "list"))
|
||||
mode = LIST;
|
||||
else if (!strcmp(args[0], "join"))
|
||||
mode = JOIN;
|
||||
@@ -324,6 +327,16 @@ configure_wireless(const char* name, char* const* args, int32 argCount)
|
||||
argCount--;
|
||||
|
||||
switch (mode) {
|
||||
case SCAN:
|
||||
{
|
||||
status_t status = device.Scan(true, true);
|
||||
if (status != B_OK) {
|
||||
fprintf(stderr, "%s: Scan on \"%s\" failed: %s\n", kProgramName,
|
||||
name, strerror(status));
|
||||
exit(1);
|
||||
}
|
||||
// fall through
|
||||
}
|
||||
case LIST:
|
||||
{
|
||||
// list wireless network(s)
|
||||
|
||||
Reference in New Issue
Block a user