mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 23:10:32 +00:00
Merge pull request #152 from retu2libc/master
Drop ethernet frames not destined for us or broadcast
This commit is contained in:
commit
91fff8c9cf
1 changed files with 10 additions and 0 deletions
|
@ -37,6 +37,16 @@ U0 NetQueueEntryHandle(CNetQueueEntry *entry)
|
|||
|
||||
EthernetFrameParse(ðernet_frame, entry->frame, entry->packet_length);
|
||||
|
||||
U8 *mac = EthernetMACGet();
|
||||
Bool is_our_mac = !MemCompare(mac, ethernet_frame.destination_address, MAC_ADDRESS_LENGTH); // check the RX packet MAC against local MAC
|
||||
Bool is_broadcast = !MemCompare(ethernet_globals.ethernet_broadcast, ethernet_frame.destination_address, MAC_ADDRESS_LENGTH); // check the RX packet MAC against broadcast MAC
|
||||
|
||||
if (!is_our_mac && !is_broadcast)
|
||||
{
|
||||
NetLog("HANDLE NETQUEUE ENTRY: Not for us, discarding.");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (ethernet_frame.ethertype)
|
||||
{
|
||||
case ETHERTYPE_ARP:
|
||||
|
|
Loading…
Reference in a new issue