Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] dhcpcd: fix 'dhcpcd_open: Bad File Descriptor' with dhcpcd-qt.
@ 2022-03-22 19:56 tibequadorian
  2022-03-29 20:52 ` tibequadorian
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tibequadorian @ 2022-03-22 19:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1367 bytes --]

There is a new pull request by tibequadorian against master on the void-packages repository

https://github.com/tibequadorian/void-packages dhcpcd
https://github.com/void-linux/void-packages/pull/36284

dhcpcd: fix 'dhcpcd_open: Bad File Descriptor' with dhcpcd-qt.
fixes #36182 which was already reported upstream https://github.com/NetworkConfiguration/dhcpcd/issues/79

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36284.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dhcpcd-36284.patch --]
[-- Type: text/x-diff, Size: 5061 bytes --]

From 7026823ecd5f0732461fae9b9b860854590a367d Mon Sep 17 00:00:00 2001
From: tibequadorian <tibequadorian@posteo.de>
Date: Tue, 22 Mar 2022 20:47:59 +0100
Subject: [PATCH] dhcpcd: fix 'dhcpcd_open: Bad File Descriptor' with
 dhcpcd-qt.

---
 srcpkgs/dhcpcd/patches/revert-eloop.patch | 150 ++++++++++++++++++++++
 srcpkgs/dhcpcd/template                   |   2 +-
 2 files changed, 151 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/dhcpcd/patches/revert-eloop.patch

diff --git a/srcpkgs/dhcpcd/patches/revert-eloop.patch b/srcpkgs/dhcpcd/patches/revert-eloop.patch
new file mode 100644
index 000000000000..e41beb84b62b
--- /dev/null
+++ b/srcpkgs/dhcpcd/patches/revert-eloop.patch
@@ -0,0 +1,150 @@
+From 2b4fe4c12b5d4366ff21fabf3a6c3799f8e4fa53 Mon Sep 17 00:00:00 2001
+From: Roy Marples <roy@marples.name>
+Date: Fri, 12 Nov 2021 16:24:32 +0000
+Subject: [PATCH] Revert "eloop: Allow eloop to process all fds returned from
+ poll(2)"
+
+This stops dumping leases when privsep is compiled out.
+This change works fine on master, but we also have eloop using
+more of a native poll(2) style interface.
+Easier for now to just revert this on the dhcpcd-9 branch.
+
+This reverts commit fe2b82eec25da908c3a1a71c2dc2402d9ff70e31.
+---
+ src/eloop.c | 56 ++++++++++++++++-------------------------------------
+ 1 file changed, 17 insertions(+), 39 deletions(-)
+
+diff --git a/src/eloop.c b/src/eloop.c
+index a6ab43fb..c3330817 100644
+--- a/src/eloop.c
++++ b/src/eloop.c
+@@ -32,7 +32,6 @@
+ #include <errno.h>
+ #include <limits.h>
+ #include <poll.h>
+-#include <stdbool.h>
+ #include <signal.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+@@ -137,7 +136,6 @@ struct eloop {
+ 	TAILQ_HEAD (event_head, eloop_event) events;
+ 	size_t nevents;
+ 	struct event_head free_events;
+-	bool events_need_setup;
+ 
+ 	struct timespec now;
+ 	TAILQ_HEAD (timeout_head, eloop_timeout) timeouts;
+@@ -284,16 +282,11 @@ eloop_reduce_timers(struct eloop *eloop)
+ static void
+ eloop_event_setup_fds(struct eloop *eloop)
+ {
+-	struct eloop_event *e, *ne;
++	struct eloop_event *e;
+ 	struct pollfd *pfd;
+ 
+ 	pfd = eloop->fds;
+-	TAILQ_FOREACH_SAFE(e, &eloop->events, next, ne) {
+-		if (e->fd == -1) {
+-			TAILQ_REMOVE(&eloop->events, e, next);
+-			TAILQ_INSERT_TAIL(&eloop->free_events, e, next);
+-			continue;
+-		}
++	TAILQ_FOREACH(e, &eloop->events, next) {
+ #ifdef ELOOP_DEBUG
+ 		fprintf(stderr, "%s(%d) fd=%d, rcb=%p, wcb=%p\n",
+ 		    __func__, getpid(), e->fd, e->read_cb, e->write_cb);
+@@ -308,7 +301,6 @@ eloop_event_setup_fds(struct eloop *eloop)
+ 		pfd->revents = 0;
+ 		pfd++;
+ 	}
+-	eloop->events_need_setup = false;
+ }
+ 
+ size_t
+@@ -376,8 +368,7 @@ eloop_event_add_rw(struct eloop *eloop, int fd,
+ 	}
+ 
+ setup:
+-	e->pollfd = NULL;
+-	eloop->events_need_setup = true;
++	eloop_event_setup_fds(eloop);
+ 	return 0;
+ }
+ 
+@@ -403,10 +394,6 @@ eloop_event_delete_write(struct eloop *eloop, int fd, int write_only)
+ 	struct eloop_event *e;
+ 
+ 	assert(eloop != NULL);
+-	if (fd == -1) {
+-		errno = EINVAL;
+-		return -1;
+-	}
+ 
+ 	TAILQ_FOREACH(e, &eloop->events, next) {
+ 		if (e->fd == fd)
+@@ -422,17 +409,16 @@ eloop_event_delete_write(struct eloop *eloop, int fd, int write_only)
+ 			goto remove;
+ 		e->write_cb = NULL;
+ 		e->write_cb_arg = NULL;
+-		if (e->pollfd != NULL) {
+-			e->pollfd->events &= ~POLLOUT;
+-			e->pollfd->revents &= ~POLLOUT;
+-		}
+-		return 1;
++		goto done;
+ 	}
+ 
+ remove:
+-	e->fd = -1;
++	TAILQ_REMOVE(&eloop->events, e, next);
++	TAILQ_INSERT_TAIL(&eloop->free_events, e, next);
+ 	eloop->nevents--;
+-	eloop->events_need_setup = true;
++
++done:
++	eloop_event_setup_fds(eloop);
+ 	return 1;
+ }
+ 
+@@ -750,9 +736,6 @@ eloop_start(struct eloop *eloop, sigset_t *signals)
+ 		} else
+ 			tsp = NULL;
+ 
+-		if (eloop->events_need_setup)
+-			eloop_event_setup_fds(eloop);
+-
+ 		n = ppoll(eloop->fds, (nfds_t)eloop->nevents, tsp, signals);
+ 		if (n == -1) {
+ 			if (errno == EINTR)
+@@ -763,23 +746,18 @@ eloop_start(struct eloop *eloop, sigset_t *signals)
+ 			continue;
+ 
+ 		TAILQ_FOREACH(e, &eloop->events, next) {
+-			/* Skip freshly added events */
+-			if (e->pollfd == NULL)
+-				continue;
+-			if (e->pollfd->revents)
+-				n--;
+-			if (e->fd != -1 && e->pollfd->revents & POLLOUT) {
+-				if (e->write_cb != NULL)
++			if (e->pollfd->revents & POLLOUT) {
++				if (e->write_cb != NULL) {
+ 					e->write_cb(e->write_cb_arg);
++					break;
++				}
+ 			}
+-			if (e->fd != -1 &&
+-			    e->pollfd != NULL && e->pollfd->revents)
+-			{
+-				if (e->read_cb != NULL)
++			if (e->pollfd->revents) {
++				if (e->read_cb != NULL) {
+ 					e->read_cb(e->read_cb_arg);
++					break;
++				}
+ 			}
+-			if (n == 0)
+-				break;
+ 		}
+ 	}
+ 
diff --git a/srcpkgs/dhcpcd/template b/srcpkgs/dhcpcd/template
index 12be60c1efcf..0d26c1abfa5a 100644
--- a/srcpkgs/dhcpcd/template
+++ b/srcpkgs/dhcpcd/template
@@ -1,7 +1,7 @@
 # Template file for 'dhcpcd'
 pkgname=dhcpcd
 version=9.4.1
-revision=1
+revision=2
 build_style=configure
 make_check_target=test
 configure_args="

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: dhcpcd: fix 'dhcpcd_open: Bad File Descriptor' with dhcpcd-qt.
  2022-03-22 19:56 [PR PATCH] dhcpcd: fix 'dhcpcd_open: Bad File Descriptor' with dhcpcd-qt tibequadorian
@ 2022-03-29 20:52 ` tibequadorian
  2022-03-30 16:52 ` 674Y3r
  2022-04-06 21:34 ` [PR PATCH] [Merged]: " leahneukirchen
  2 siblings, 0 replies; 4+ messages in thread
From: tibequadorian @ 2022-03-29 20:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

New comment by tibequadorian on void-packages repository

https://github.com/void-linux/void-packages/pull/36284#issuecomment-1082362545

Comment:
Does this PR fix it for you? @674Y3r 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: dhcpcd: fix 'dhcpcd_open: Bad File Descriptor' with dhcpcd-qt.
  2022-03-22 19:56 [PR PATCH] dhcpcd: fix 'dhcpcd_open: Bad File Descriptor' with dhcpcd-qt tibequadorian
  2022-03-29 20:52 ` tibequadorian
@ 2022-03-30 16:52 ` 674Y3r
  2022-04-06 21:34 ` [PR PATCH] [Merged]: " leahneukirchen
  2 siblings, 0 replies; 4+ messages in thread
From: 674Y3r @ 2022-03-30 16:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 217 bytes --]

New comment by 674Y3r on void-packages repository

https://github.com/void-linux/void-packages/pull/36284#issuecomment-1083383181

Comment:
Yes. I've been using it for the third day and haven't observed any problems.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Merged]: dhcpcd: fix 'dhcpcd_open: Bad File Descriptor' with dhcpcd-qt.
  2022-03-22 19:56 [PR PATCH] dhcpcd: fix 'dhcpcd_open: Bad File Descriptor' with dhcpcd-qt tibequadorian
  2022-03-29 20:52 ` tibequadorian
  2022-03-30 16:52 ` 674Y3r
@ 2022-04-06 21:34 ` leahneukirchen
  2 siblings, 0 replies; 4+ messages in thread
From: leahneukirchen @ 2022-04-06 21:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]

There's a merged pull request on the void-packages repository

dhcpcd: fix 'dhcpcd_open: Bad File Descriptor' with dhcpcd-qt.
https://github.com/void-linux/void-packages/pull/36284

Description:
fixes #36182 which was already reported upstream https://github.com/NetworkConfiguration/dhcpcd/issues/79

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-06 21:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-22 19:56 [PR PATCH] dhcpcd: fix 'dhcpcd_open: Bad File Descriptor' with dhcpcd-qt tibequadorian
2022-03-29 20:52 ` tibequadorian
2022-03-30 16:52 ` 674Y3r
2022-04-06 21:34 ` [PR PATCH] [Merged]: " leahneukirchen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).