Commit 631fde70 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

inetmib1: Fix the IPv4 address network order for comparisons.

compareUdpRow() was already performing the byte-swaps but compareIpAddrRow() and compareIpForwardRow() need them too. Signed-off-by: 's avatarFrancois Gouget <fgouget@codeweavers.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 85c6caf6
...@@ -778,7 +778,7 @@ static int __cdecl DWORD_cmp(DWORD a, DWORD b) ...@@ -778,7 +778,7 @@ static int __cdecl DWORD_cmp(DWORD a, DWORD b)
static int __cdecl compareIpAddrRow(const void *a, const void *b) static int __cdecl compareIpAddrRow(const void *a, const void *b)
{ {
const MIB_IPADDRROW *rowA = a, *rowB = b; const MIB_IPADDRROW *rowA = a, *rowB = b;
return DWORD_cmp(rowA->dwAddr, rowB->dwAddr); return DWORD_cmp(ntohl(rowA->dwAddr), ntohl(rowB->dwAddr));
} }
static BOOL mib2IpAddrQuery(BYTE bPduType, SnmpVarBind *pVarBind, static BOOL mib2IpAddrQuery(BYTE bPduType, SnmpVarBind *pVarBind,
...@@ -870,7 +870,7 @@ static void oidToIpForwardRow(AsnObjectIdentifier *oid, void *dst) ...@@ -870,7 +870,7 @@ static void oidToIpForwardRow(AsnObjectIdentifier *oid, void *dst)
static int __cdecl compareIpForwardRow(const void *a, const void *b) static int __cdecl compareIpForwardRow(const void *a, const void *b)
{ {
const MIB_IPFORWARDROW *rowA = a, *rowB = b; const MIB_IPFORWARDROW *rowA = a, *rowB = b;
return DWORD_cmp(rowA->dwForwardDest, rowB->dwForwardDest); return DWORD_cmp(ntohl(rowA->dwForwardDest), ntohl(rowB->dwForwardDest));
} }
static BOOL mib2IpRouteQuery(BYTE bPduType, SnmpVarBind *pVarBind, static BOOL mib2IpRouteQuery(BYTE bPduType, SnmpVarBind *pVarBind,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment