dhcpcd/dhcpcd-10.0.2-test.patch

28 lines
869 B
Diff
Raw Normal View History

2023-07-23 13:47:15 +00:00
From 5836269b2a1ba55ba9b0f2efdbc4fdca4853d452 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
Date: Sun, 23 Jul 2023 15:44:32 +0200
Subject: [PATCH] Do not crash on dhcpcd test run
Check if state->bpf is allocated before attempting to write there.
---
src/dhcp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/dhcp.c b/src/dhcp.c
index edd1c01..e029cee 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -3314,7 +3314,8 @@ dhcp_handledhcp(struct interface *ifp, struct bootp *bootp, size_t bootp_len,
state->reason = "TEST";
script_runreason(ifp, state->reason);
eloop_exit(ifp->ctx->eloop, EXIT_SUCCESS);
- state->bpf->bpf_flags |= BPF_EOF;
+ if (state->bpf)
+ state->bpf->bpf_flags |= BPF_EOF;
return;
}
eloop_timeout_delete(ifp->ctx->eloop, send_discover, ifp);
--
2.41.0