- Fix failing test case caused by bad word ordering.
This commit is contained in:
@@ -1014,6 +1014,16 @@ static BOOL WinDivertTokenizeFilter(const char *filter, WINDIVERT_LAYER layer,
|
||||
SetLastError(0);
|
||||
if (WinDivertHelperParseIPv6Address(token, tokens[tp].val))
|
||||
{
|
||||
// Work-around the different word orderings between the
|
||||
// DLL vs SYS.
|
||||
UINT32 tmp;
|
||||
tmp = tokens[tp].val[0];
|
||||
tokens[tp].val[0] = tokens[tp].val[3];
|
||||
tokens[tp].val[3] = tmp;
|
||||
tmp = tokens[tp].val[1];
|
||||
tokens[tp].val[1] = tokens[tp].val[2];
|
||||
tokens[tp].val[2] = tmp;
|
||||
|
||||
tokens[tp].kind = FILTER_TOKEN_NUMBER;
|
||||
tp++;
|
||||
continue;
|
||||
|
||||
+12
-12
@@ -3048,23 +3048,23 @@ static BOOL windivert_filter(PNET_BUFFER buffer, UINT32 if_idx,
|
||||
field[0] = (UINT32)ipv6_header->HopLimit;
|
||||
break;
|
||||
case WINDIVERT_FILTER_FIELD_IPV6_SRCADDR:
|
||||
field[0] =
|
||||
(UINT32)RtlUlongByteSwap(ipv6_header->SrcAddr[0]);
|
||||
field[1] =
|
||||
(UINT32)RtlUlongByteSwap(ipv6_header->SrcAddr[1]);
|
||||
field[2] =
|
||||
(UINT32)RtlUlongByteSwap(ipv6_header->SrcAddr[2]);
|
||||
field[3] =
|
||||
(UINT32)RtlUlongByteSwap(ipv6_header->SrcAddr[0]);
|
||||
field[2] =
|
||||
(UINT32)RtlUlongByteSwap(ipv6_header->SrcAddr[1]);
|
||||
field[1] =
|
||||
(UINT32)RtlUlongByteSwap(ipv6_header->SrcAddr[2]);
|
||||
field[0] =
|
||||
(UINT32)RtlUlongByteSwap(ipv6_header->SrcAddr[3]);
|
||||
break;
|
||||
case WINDIVERT_FILTER_FIELD_IPV6_DSTADDR:
|
||||
field[0] =
|
||||
(UINT32)RtlUlongByteSwap(ipv6_header->DstAddr[0]);
|
||||
field[1] =
|
||||
(UINT32)RtlUlongByteSwap(ipv6_header->DstAddr[1]);
|
||||
field[2] =
|
||||
(UINT32)RtlUlongByteSwap(ipv6_header->DstAddr[2]);
|
||||
field[3] =
|
||||
(UINT32)RtlUlongByteSwap(ipv6_header->DstAddr[0]);
|
||||
field[2] =
|
||||
(UINT32)RtlUlongByteSwap(ipv6_header->DstAddr[1]);
|
||||
field[1] =
|
||||
(UINT32)RtlUlongByteSwap(ipv6_header->DstAddr[2]);
|
||||
field[0] =
|
||||
(UINT32)RtlUlongByteSwap(ipv6_header->DstAddr[3]);
|
||||
break;
|
||||
case WINDIVERT_FILTER_FIELD_ICMP_TYPE:
|
||||
|
||||
Reference in New Issue
Block a user