1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-12 02:34:59 +03:00

Cedar: Improve IsPacketForMe()'s "data" argumment in PROTO_IMPL

This allows a protocol implementation to implicitly cast the variable to the type it prefers.
This commit is contained in:
Davide Beatrici
2020-07-29 20:00:46 +02:00
parent b339104f4f
commit d8aa470192
3 changed files with 10 additions and 11 deletions

View File

@ -69,16 +69,17 @@ void OvsFree(void *param)
}
// Check whether it's an OpenVPN packet
bool OvsIsPacketForMe(const PROTO_MODE mode, const UCHAR *data, const UINT size)
bool OvsIsPacketForMe(const PROTO_MODE mode, const void *data, const UINT size)
{
if (data == NULL || size < 2)
{
return false;
}
if (mode == PROTO_MODE_TCP)
{
if (data == NULL || size < 2)
{
return false;
}
if (data[0] == 0x00 && data[1] == 0x0E)
const UCHAR *raw = data;
if (raw[0] == 0x00 && raw[1] == 0x0E)
{
return true;
}