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

IPv4: More work on UDP support.

I'm now able to connect to a simple UDP server on my host machine and
exchange some data. Very cool! :^)
This commit is contained in:
Andreas Kling 2019-03-13 15:40:30 +01:00
parent 48431b3535
commit 4dddf949c8
4 changed files with 34 additions and 10 deletions

View file

@ -232,7 +232,7 @@ void handle_udp(const EthernetFrameHeader& eth, int frame_size)
LOCKER(IPv4Socket::all_sockets().lock());
for (RetainPtr<IPv4Socket> socket : IPv4Socket::all_sockets().resource()) {
LOCKER(socket->lock());
if (socket->protocol() != (unsigned)IPv4Protocol::UDP)
if (socket->type() != SOCK_DGRAM)
continue;
if (socket->source_port() != udp_packet.destination_port())
continue;