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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user