FreeBSD Bugzilla – Attachment 219061 Details for
Bug 250561
net/dhcpcd: (9.2.0) endless CPU spinning and logspam 'ps_bpf_recvbpf: Device not configured' after Mellanox NIC reinitializes after suspend
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Close BPF socket on ENXIO
dhcpcd-bpf-enxio.diff (text/plain), 1.23 KB, created by
roy
on 2020-10-25 15:06:06 UTC
(
hide
)
Description:
Close BPF socket on ENXIO
Filename:
MIME Type:
Creator:
roy
Created:
2020-10-25 15:06:06 UTC
Size:
1.23 KB
patch
obsolete
>diff --git a/src/privsep-bpf.c b/src/privsep-bpf.c >index ddd3cd82..23da9a07 100644 >--- a/src/privsep-bpf.c >+++ b/src/privsep-bpf.c >@@ -70,9 +70,21 @@ ps_bpf_recvbpf(void *arg) > * This mechanism allows us to read each packet from the buffer. */ > while (!(bpf->bpf_flags & BPF_EOF)) { > len = bpf_read(bpf, buf, sizeof(buf)); >- if (len == -1) >- logerr(__func__); >- if (len == -1 || len == 0) >+ if (len == -1) { >+ int error = errno; >+ >+ logerr("%s: %s", psp->psp_ifname, __func__); >+ if (error != ENXIO) >+ break; >+ /* If the interface has departed, close the BPF >+ * socket. This stops log spam if RTM_IFANNOUNCE is >+ * delayed in announcing the departing interface. */ >+ eloop_event_delete(psp->psp_ctx->eloop, bpf->bpf_fd); >+ bpf_close(bpf); >+ psp->psp_bpf = NULL; >+ break; >+ } >+ if (len == 0) > break; > psm.ps_flags = bpf->bpf_flags; > len = ps_sendpsmdata(psp->psp_ctx, psp->psp_ctx->ps_data_fd, >@@ -107,6 +119,12 @@ ps_bpf_recvmsgcb(void *arg, struct ps_msghdr *psm, struct msghdr *msg) > return -1; > } > >+ /* We might have had an earlier ENXIO error. */ >+ if (psp->psp_bpf == NULL) { >+ errno = ENXIO; >+ return -1; >+ } >+ > return bpf_send(psp->psp_bpf, psp->psp_proto, > iov->iov_base, iov->iov_len); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
roy:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 250561
:
219054
|
219060
| 219061