Skip to content

Commit 254e757

Browse files
jukkarcarlescufi
authored andcommitted
net: dhcpv4: Do not wait forever when allocating net_pkt
As the allocation is run in system workqueue context, it can cause problems if waiting forever when allocating net_pkt. Fixes #77935 Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 951b494 commit 254e757

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/net/lib/dhcpv4/dhcpv4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ LOG_MODULE_REGISTER(net_dhcpv4, CONFIG_NET_DHCPV4_LOG_LEVEL);
3939
#include <zephyr/sys/slist.h>
4040
#include <zephyr/sys/util.h>
4141

42-
#define PKT_WAIT_TIME K_SECONDS(1)
42+
#define PKT_WAIT_TIME K_MSEC(100)
4343

4444
static K_MUTEX_DEFINE(lock);
4545

@@ -285,7 +285,7 @@ static struct net_pkt *dhcpv4_create_message(struct net_if *iface, uint8_t type,
285285
#endif
286286

287287
pkt = net_pkt_alloc_with_buffer(iface, size, AF_INET,
288-
IPPROTO_UDP, K_FOREVER);
288+
IPPROTO_UDP, PKT_WAIT_TIME);
289289
if (!pkt) {
290290
return NULL;
291291
}

0 commit comments

Comments
 (0)