1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:08:13 +00:00

Kernel: Don't go through ARP for IP broadcast messages

This commit is contained in:
AnotherTest 2021-02-15 21:20:15 +03:30 committed by Andreas Kling
parent ce13b258ca
commit 4043e770e5

View file

@ -205,6 +205,12 @@ RoutingDecision route_to(const IPv4Address& target, const IPv4Address& source, c
return { nullptr, {} };
}
// If it's a broadcast, we already know everything we need to know.
// FIXME: We should also deal with the case where `target_addr` is
// a broadcast to a subnet rather than a full broadcast.
if (target_addr == 0xffffffff && matches(adapter))
return { adapter, { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } };
{
LOCKER(arp_table().lock());
auto addr = arp_table().resource().get(next_hop_ip);