diff --git a/dhcpcd-10.0.2-test.patch b/dhcpcd-10.0.2-test.patch new file mode 100644 index 0000000..10bff9b --- /dev/null +++ b/dhcpcd-10.0.2-test.patch @@ -0,0 +1,27 @@ +From 5836269b2a1ba55ba9b0f2efdbc4fdca4853d452 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= +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 + diff --git a/dhcpcd.spec b/dhcpcd.spec index e34dd64..510c597 100644 --- a/dhcpcd.spec +++ b/dhcpcd.spec @@ -14,6 +14,10 @@ Source2: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xa785ed2755955d9 Source3: %{name}.service Source4: %{name}@.service Source5: systemd-sysusers.conf + +# https://github.com/NetworkConfiguration/dhcpcd/pull/231 +Patch1: dhcpcd-10.0.2-test.patch + BuildRequires: gcc BuildRequires: systemd-rpm-macros BuildRequires: chrony @@ -33,7 +37,7 @@ through NDP, DHCPv4 and DHCPv6 protocols. %if 0%{?fedora} || 0%{?rhel} > 8 %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %endif -%autosetup +%autosetup -p1 %build %configure \