1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-12-27 10:39:53 +03:00

Cedar/IPC: Fix MAC address for IPv4 multicast

This commit is contained in:
domosekai 2021-04-24 01:46:31 +00:00
parent 19af52e288
commit cca769e2e6

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;
}
}