- Package:
- wide-dhcpv6-client
- Source:
- wide-dhcpv6-client
- Description:
- DHCPv6 client for automatic IPv6 hosts configuration
- Submitter:
- Phil Leinster
- Date:
- 2025-03-18 08:51:01 UTC
- Severity:
- normal
- Tags:
Dear Maintainer,
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
If the network layer becomes unready, or the service starts before
the network interface is ready, the service fails to operate on that
interface. The following message is logged "client6_send: transmit
failed: Network is unreachable"
* What exactly did you do (or not do) that was effective (or
ineffective)?
Normal network activity. PPP interfaces are particularly affected
due to their non-permanent status.
* What was the outcome of this action?
IPv6 address was not requested and the lease lapsed after the
timeout.
* What outcome did you expect instead?
Standard IPv6 connectivity without interruption.
This issue can be worked around with a restart of the service.
*** End of the template - remove these template lines ***
I was being annoyed by this bug today. It doesn’t happen often but I suspect when patching the ppp daemon or ISP changes the ppp interface gets a new ID.
strace -p 294339
strace: Process 294339 attached
select(7, [4 6], NULL, NULL, {tv_sec=92, tv_usec=146932}) = 0 (Timeout)
sendto(4, “XXXXXXXXX"..., 48, 0, {sa_family=AF_INET6, sin6_port=htons(547), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "ff02::1:2", &sin6_addr), sin6_scope_id=13}, 28) = -1 ENETUNREACH (Network is unreachable)
getpid() = 294339
sendto(3, "<27>Jun 13 16:15:53 dhcp6c[29433"..., 89, MSG_NOSIGNAL, NULL, 0) = 89
select(7, [4 6], NULL, NULL, {tv_sec=117, tv_usec=240413}^Cstrace: Process 294339 detached
<detached …>
I’m not 100% sure but if the sin6_scope_id=13 matched the same ID returned by "ip a” it has definitely changed.
My current thought is when the error occurs to assume a linked problem and try an ifreset(ifp) then retry the block:
dst.sin6_scope_id = ifp->linkid;
if (sendto(sock, buf, len, 0, (struct sockaddr *)&dst,
sysdep_sa_len((struct sockaddr *)&dst)) == -1) {
debug_printf(LOG_ERR, FNAME,
"transmit failed: %s", strerror(errno));
goto end;
}
My first task is to try and reproduce when the family won’t notice. Play for this weekend maybe.
I’ve been running with the patch to dhcp6c.c for a while
1378,1381d1377
< /*
< * failed send. Possible change of interface id per Bug#1035395
< * Try reseting and resend
< */
1384,1398d1379
< if (ifreset(ifp)) {
< debug_printf(LOG_ERR, FNAME,
< "reset failed: %s", strerror(errno));
< } else {
< dst.sin6_scope_id = ifp->linkid;
<
< if (sendto(sock, buf, len, 0, (struct sockaddr *)&dst,
< sysdep_sa_len((struct sockaddr *)&dst)) == -1) {
< debug_printf(LOG_ERR, FNAME,
< "retransmit failed: %s", strerror(errno));
< } else {
< debug_printf(LOG_DEBUG, FNAME, "resend %s to %s",
< dhcp6msgstr(dh6->dh6_msgtype), addr2str((struct sockaddr *)&dst));
< }
< }
I’m still not sure if this is over thinking the solution. It is tempting to just run the ifreset(ifs) before every send.
Behaviour is pretty good when the interface is down. The ifreset fails and the slow retry loop fixes it up next time.
dhcp6c[1844536]: client6_send: transmit failed: Network is unreachable
dhcp6c[1844536]: ifreset: invalid interface(ppp0): No such device
dhcp6c[1844536]: client6_send: reset failed: No such device
control: tag -1 +patch Thanks for the report, and patch! Seems like it's not good idea to add this patch before a new debian release (soon). I'll add this after the next debian release.