1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-09-18 01:33:00 +03:00

Merge PR #1337: Cedar/IPC: Fix MAC address for IPv4 multicast

This commit is contained in:
Davide Beatrici 2021-04-24 04:01:58 +02:00 committed by GitHub
commit 285e322171
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1684,7 +1684,21 @@ void IPCSendIPv4(IPC *ipc, void *data, UINT size)
else if (ipv4[0] >= 224 && ipv4[0] <= 239)
{
// IPv4 Multicast
is_broadcast = true;
UCHAR dest[6];
// Per RFC 1112, multicast MAC address has the form 01-00-5E-00-00-00,
// where the lowest 23 bits are copied from the destination IP address.
dest[0] = 0x01;
dest[1] = 0x00;
dest[2] = 0x5e;
dest[3] = 0x7f & ipv4[1];
dest[4] = ipv4[2];
dest[5] = ipv4[3];
// Send
IPCSendIPv4WithDestMacAddr(ipc, data, size, dest);
return;
}
}