Skip to content

Commit b05aa8d

Browse files
committed
Support wlan in network-interface-list on pre-Vista Windows
* src/w32.c (network_interface_list): Check for 'Wireless' in adapter description to support pre-Vista Windows.
1 parent 25d4bf4 commit b05aa8d

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/w32.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9540,8 +9540,23 @@ network_interface_list (bool full, unsigned short match)
95409540
switch (adapter->IfType)
95419541
{
95429542
case IF_TYPE_ETHERNET_CSMACD:
9543-
ifmt_idx = ETHERNET;
9544-
if_num = eth_count++;
9543+
/* Windows before Vista reports wireless adapters as
9544+
Ethernet. Work around by looking at the Description
9545+
string. */
9546+
{
9547+
char description[MAX_UTF8_PATH];
9548+
if (filename_from_utf16 (adapter->Description, description) == 0
9549+
&& strstr (description, "Wireless "))
9550+
{
9551+
ifmt_idx = WLAN;
9552+
if_num = wlan_count++;
9553+
}
9554+
else
9555+
{
9556+
ifmt_idx = ETHERNET;
9557+
if_num = eth_count++;
9558+
}
9559+
}
95459560
break;
95469561
case IF_TYPE_ISO88025_TOKENRING:
95479562
ifmt_idx = TOKENRING;

0 commit comments

Comments
 (0)