inetmib1: Fix endianess issue with dwLocalAddr and dwLocalPort.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52224
Signed-off-by: Bernhard Übelacker <bernhardu@mailbox.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 9145b551b2
)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
parent
4642de1d6c
commit
749d5efa7e
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
|
#include "winsock2.h"
|
||||||
#include "snmp.h"
|
#include "snmp.h"
|
||||||
#include "iphlpapi.h"
|
#include "iphlpapi.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
@ -1217,7 +1218,7 @@ static void oidToUdpRow(AsnObjectIdentifier *oid, void *dst)
|
||||||
|
|
||||||
assert(oid && oid->idLength >= 5);
|
assert(oid && oid->idLength >= 5);
|
||||||
row->dwLocalAddr = oidToIpAddr(oid);
|
row->dwLocalAddr = oidToIpAddr(oid);
|
||||||
row->dwLocalPort = oid->ids[4];
|
row->dwLocalPort = htons(oid->ids[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __cdecl compareUdpRow(const void *a, const void *b)
|
static int __cdecl compareUdpRow(const void *a, const void *b)
|
||||||
|
@ -1225,9 +1226,9 @@ static int __cdecl compareUdpRow(const void *a, const void *b)
|
||||||
const MIB_UDPROW *key = a, *value = b;
|
const MIB_UDPROW *key = a, *value = b;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = key->dwLocalAddr - value->dwLocalAddr;
|
ret = ntohl(key->dwLocalAddr) - ntohl(value->dwLocalAddr);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = key->dwLocalPort - value->dwLocalPort;
|
ret = ntohs(key->dwLocalPort) - ntohs(value->dwLocalPort);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1269,8 +1270,9 @@ static BOOL mib2UdpEntryQuery(BYTE bPduType, SnmpVarBind *pVarBind,
|
||||||
udpTable->table[tableIndex - 1].dwLocalAddr);
|
udpTable->table[tableIndex - 1].dwLocalAddr);
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
|
UINT id = ntohs(udpTable->table[tableIndex - 1].dwLocalPort);
|
||||||
oid.idLength = 1;
|
oid.idLength = 1;
|
||||||
oid.ids = &udpTable->table[tableIndex - 1].dwLocalPort;
|
oid.ids = &id;
|
||||||
ret = SnmpUtilOidAppend(&pVarBind->name, &oid);
|
ret = SnmpUtilOidAppend(&pVarBind->name, &oid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue