Re: dhcp6_listen: Address already in use
Roy Marples
Thu May 17 06:20:43 2018
On 17/05/2018 01:55, Moritz Warning wrote:
On 05/16/2018 09:37 PM, Roy Marples wrote:
On 16/05/2018 17:01, Moritz Warning wrote:
On 05/16/2018 10:28 AM, Roy Marples wrote:
Hi Moritz
On 15/05/2018 23:37, Moritz Warning wrote:
from dhcpcd 7.0.4-1 on Arch Linux gives me "dhcp6_listen: Address already in use" and exits.
The problem appears when connecting to my WLAN using wicd 1.7.4-1:
May 15 23:26:22 brick dhcpcd[18975]: forked to background, child pid 19022
May 15 23:26:22 brick dhcpcd[18975]: dhcp6_listen: Address already in use
Attached patch should solve this error.
May 15 23:26:22 brick dhcpcd[19025]: sending signal ALRM to pid 19022
May 15 23:26:22 brick dhcpcd[19025]: waiting for pid 19022 to exit
May 15 23:26:22 brick dhcpcd[19022]: received SIGALRM, releasing
Something called `dhcpcd -k` here which releases the lease as you see.
I think that is the real error - does wicd do that?
Yes, wicd calls "dhcpcd -k" when it detects no ip address on the specified interface.
Can you let me know if the patch addresses the listen error please?
Thanks
Roy
The error still appears.
That is odd.
Try this new patch which logs a lot more, if you post a new log it
should say which address is failing.
But the connection also fails sometimes when the error is not showing up.
It is that way even without the patch. So it might not be the cause.
Is this "sending signal ALRM to pid 19022" part of the shutdown sequence of dhcpcd?
Yes. because dhcpcd itself logged sending signal on a different pid,
it's clear something called `dhcpcd -k` to shut it down. This is likely
wicd and likely because dhcpcd forked when getting a working IPv6
address an wicd expects a working IPv4 address.
Try adding `waitip 4` to /etc/dhcpcd.conf
Roy
diff --git a/src/dhcp6.c b/src/dhcp6.c
index 399f3785..9d522dda 100644
--- a/src/dhcp6.c
+++ b/src/dhcp6.c
@@ -3611,6 +3611,8 @@ dhcp6_listen(struct dhcpcd_ctx *ctx, struct ipv6_addr *ia)
struct sockaddr_in6 sa;
int n, s;
+ loginfox("LISTENING TO %s", ia == NULL ? NULL : ia->saddr);
+
#define SOCK_FLAGS SOCK_CLOEXEC | SOCK_NONBLOCK
s = xsocket(PF_INET6, SOCK_DGRAM | SOCK_FLAGS, IPPROTO_UDP);
#undef SOCK_FLAGS
diff --git a/src/ipv6.c b/src/ipv6.c
index 82cf71b6..9a4e6d81 100644
--- a/src/ipv6.c
+++ b/src/ipv6.c
@@ -1175,8 +1175,11 @@ ipv6_handleifa(struct dhcpcd_ctx *ctx,
}
if (ia != NULL) {
- ipv6nd_handleifa(cmd, ia, pid);
- dhcp6_handleifa(cmd, ia, pid);
+ /* Don't run handlers if forked from the DaD callback */
+ if (!(ctx->options & DHCPCD_FORKED)) {
+ ipv6nd_handleifa(cmd, ia, pid);
+ dhcp6_handleifa(cmd, ia, pid);
+ }
/* Done with the ia now, so free it. */
if (cmd == RTM_DELADDR)
Archive administrator: postmaster@marples.name