From 5b5dca8137bab1fd863b5e7d877e2f156ce8f8f7 Mon Sep 17 00:00:00 2001 From: Matheus Date: Tue, 12 Aug 2025 23:43:06 -0300 Subject: [PATCH] arp: fix race between init and incoming packets --- kernel-src/io/net/arp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel-src/io/net/arp.c b/kernel-src/io/net/arp.c index ae3f6318..3cffb0ca 100644 --- a/kernel-src/io/net/arp.c +++ b/kernel-src/io/net/arp.c @@ -179,6 +179,10 @@ static void handlerthreadfn() { // executed in dpc context void arp_process(netdev_t *netdev, void *buffer) { + // not initialized yet + if (handlerthread == NULL) + return; + arpframe_t *frame = buffer; if (frame->hwtype != cpu_to_be_w(1)) // ethernet return;