Francois Gouget : inetmib1: Fix the IPv4 address network order for comparisons.
Module: wine Branch: stable Commit: 43e9041e13ed1462bf0693d90d805e6b4d4b137d URL: https://gitlab.winehq.org/wine/wine/-/commit/43e9041e13ed1462bf0693d90d805e6... Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Wed Feb 16 13:05:55 2022 +0100 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: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 631fde70b8da49de63eca1e161c9b0059b0ad61c) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/inetmib1/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/inetmib1/main.c b/dlls/inetmib1/main.c index f9ef113aad9..b3074c415b0 100644 --- a/dlls/inetmib1/main.c +++ b/dlls/inetmib1/main.c @@ -778,7 +778,7 @@ static int __cdecl DWORD_cmp(DWORD a, DWORD b) static int __cdecl compareIpAddrRow(const void *a, const void *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, @@ -870,7 +870,7 @@ static void oidToIpForwardRow(AsnObjectIdentifier *oid, void *dst) static int __cdecl compareIpForwardRow(const void *a, const void *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,
participants (1)
-
Alexandre Julliard