Skip to content

Commit

Permalink
Ignore case in comparing NPF_Loopback name, since we canonicalize to …
Browse files Browse the repository at this point in the history
…all-caps
  • Loading branch information
bonsaiviking committed Apr 9, 2021
1 parent 8b45da3 commit 422845c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packetWin7/Dll/Packet32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3799,11 +3799,11 @@ BOOLEAN PacketIsLoopbackAdapter(PCHAR AdapterName)
ret = FALSE;
}
// Compare to NPF_Loopback
else if (strcmp(AdapterName + sizeof(DEVICE_PREFIX) - 1, NPCAP_LOOPBACK_ADAPTER_BUILTIN) == 0 ||
else if (_stricmp(AdapterName + sizeof(DEVICE_PREFIX) - 1, NPCAP_LOOPBACK_ADAPTER_BUILTIN) == 0 ||
// or compare to value in Registry, if it's found and long enough.
(strlen(g_strLoopbackAdapterName) > sizeof(DEVICE_PREFIX) &&
strlen(AdapterName) > sizeof(DEVICE_PREFIX) - 1 + sizeof(NPF_DEVICE_NAMES_PREFIX) &&
strcmp(g_strLoopbackAdapterName + sizeof(DEVICE_PREFIX) - 1,
_stricmp(g_strLoopbackAdapterName + sizeof(DEVICE_PREFIX) - 1,
AdapterName + sizeof(DEVICE_PREFIX) - 1 + sizeof(NPF_DEVICE_NAMES_PREFIX) - 1) == 0)
)
{
Expand Down

0 comments on commit 422845c

Please sign in to comment.