dhcpcd icon indicating copy to clipboard operation
dhcpcd copied to clipboard

SIOCSPFXFLUSH_IN6: No buffer space available after updating to 10.3.0 (FreeBSD 14.3)

Open athanp opened this issue 1 month ago • 14 comments

After years of trouble-free operation of the following dhcpcd setup, it fails with "SIOCSPFXFLUSH_IN6: No buffer space available" This problem arose after upgrading to dhcpcd 10.3.0 on my FreeBSD 14.3 installation.

quiet
ipv6only
noipv6rs
release
background
vendorclassid
slaac private

clientid
allowinterfaces ng0
nohook test,hostname,resolv.conf,ntp.conf

option interface_mtu
option classless_static_routes
require dhcp_server_identifier

interface ng0
  ipv6rs
  ia_pd 1/::/56 bridge0/0/64

athanp avatar Nov 16 '25 14:11 athanp

Same on my OpenBSD build. Many "No buffer space available" errors:

Nov 16 17:43:32 router dhcpcd[99330]: em0: if_af_attach: No buffer space available
Nov 16 17:43:32 router dhcpcd[99330]: em0: config file changed, expiring leases
Nov 16 17:43:32 router dhcpcd[99330]: script_runreason: No buffer space available
Nov 16 17:43:32 router dhcpcd[99330]: /var/db/dhcpcd/duid: Undefined error: 0
Nov 16 17:43:32 router dhcpcd[99330]: duid_get: cannot write duid: No buffer space available
Nov 16 17:43:32 router dhcpcd[99330]: ipv6_readsecret: cannot read secret: Inappropriate ioctl for device
Nov 16 17:43:32 router dhcpcd[99330]: ipv6_readsecret: cannot write secret: No buffer space available
Nov 16 17:43:32 router dhcpcd[99330]: ipv6_newaddr: No buffer space available

DigitalDJ avatar Nov 16 '25 14:11 DigitalDJ

@athanp is it only SIOCSPFXFLUSH_IN6 that is reporting the error for you? Does it fail to start after that?

@DigitalDJ what OpenBSD version are you using?

rsmarples avatar Nov 17 '25 11:11 rsmarples

For me, this is OpenBSD 7.8. Was in the middle of trying to figure out which commit causes this....but if you have any ideas so I can focus and figure it out that would be great :) I assume it's related to the OP, but maybe not?

DigitalDJ avatar Nov 17 '25 11:11 DigitalDJ

Does this patch help both of you?

--- a/src/eloop.c
+++ b/src/eloop.c
@@ -36,6 +36,7 @@
  * On Linux use epoll(7)
  * Everywhere else use ppoll(2)
  */
+#undef BSD
 #ifdef BSD
 #include <sys/event.h>
 #define USE_KQUEUE

rsmarples avatar Nov 17 '25 11:11 rsmarples

Unfortunately not. I subbed in a patched executable to the environment and did a rcctl restart dhcpcd

Nov 17 23:48:09 router dhcpcd[3027]: dhcpcd-10.3.0 starting
Nov 17 23:48:09 router dhcpcd[61299]: DUID xxxxx
Nov 17 23:48:09 router dhcpcd[61299]: em0: if_af_attach: No buffer space available
Nov 17 23:48:09 router dhcpcd[61299]: em2: if_af_attach: No buffer space available
Nov 17 23:48:09 router dhcpcd[61299]: script_runreason: Inappropriate ioctl for device
Nov 17 23:48:09 router last message repeated 3 times
Nov 17 23:48:09 router dhcpcd[61299]: em0: IAID xxx
Nov 17 23:48:09 router dhcpcd[61299]: em2: IAID xxx
Nov 17 23:48:10 router dhcpcd[61299]: em2: soliciting a DHCP lease
Nov 17 23:48:10 router dhcpcd[61299]: em2: interface mtu is too small (0<328): Undefined error: 0
Nov 17 23:48:10 router dhcpcd[61299]: em0: soliciting an IPv6 router
Nov 17 23:48:10 router dhcpcd[61299]: em0: Router Advertisement from fe80:xxx
Nov 17 23:48:10 router dhcpcd[61299]: em0: advertised MTU 1500 is greater than link MTU 24
Nov 17 23:48:10 router dhcpcd[61299]: em0: adding default route via fe80::xxx
Nov 17 23:48:10 router dhcpcd[61299]: if_route (CHG): No buffer space available
Nov 17 23:48:10 router dhcpcd[61299]: if_route (DEL): No buffer space available
Nov 17 23:48:10 router dhcpcd[61299]: if_route (ADD): No buffer space available
Nov 17 23:48:10 router dhcpcd[61299]: script_runreason: No buffer space available
Nov 17 23:48:10 router dhcpcd[61299]: em0: option overflow
Nov 17 23:48:10 router dhcpcd[61299]: em0: no useable IA found in lease
Nov 17 23:48:10 router dhcpcd[61299]: em0: soliciting a DHCPv6 lease
Nov 17 23:48:10 router dhcpcd[61299]: em2: soliciting an IPv6 router
Nov 17 23:48:10 router dhcpcd[61299]: em2: Router Advertisement from fe80:xxx
Nov 17 23:48:10 router dhcpcd[61299]: em2: advertised MTU 1500 is greater than link MTU 24
Nov 17 23:48:10 router dhcpcd[61299]: ipv6_readsecret: cannot read secret: Undefined error: 0
Nov 17 23:48:10 router dhcpcd[61299]: em2: adding address 2001:xxxx
Nov 17 23:48:10 router dhcpcd[61299]: em2: adding route to 2001:xxxx::/64
Nov 17 23:48:10 router dhcpcd[61299]: em2: requesting DHCPv6 information
Nov 17 23:48:11 router dhcpcd[61299]: em0: read_lease: truncated lease
Nov 17 23:48:11 router dhcpcd[61299]: em0: soliciting a DHCP lease
Nov 17 23:48:11 router dhcpcd[61299]: em0: interface mtu is too small (0<328): Undefined error: 0
Nov 17 23:48:11 router dhcpcd[61299]: em0: DHCPv6 REPLY: Sorry, no address could be allocated.
Nov 17 23:48:11 router dhcpcd[61299]: em2: REPLY6 received from fe80:xxxx
Nov 17 23:48:11 router dhcpcd[61299]: em2: refresh in 86400 seconds
Nov 17 23:48:11 router dhcpcd[61299]: dhcp_writefile: /var/db/dhcpcd/em2.lease6: No buffer space available
Nov 17 23:48:11 router dhcpcd[61299]: script_runreason: No buffer space available
Nov 17 23:48:12 router dhcpcd[61299]: em0: DHCPv6 REPLY: Sorry, no address could be allocated.
Nov 17 23:48:13 router dhcpcd[61299]: em2: if_getmtu: No buffer space available
Nov 17 23:48:14 router dhcpcd[61299]: em0: if_getmtu: No buffer space available
Nov 17 23:48:15 router dhcpcd[61299]: em2: probing for an IPv4LL address
Nov 17 23:48:15 router dhcpcd[61299]: em0: DHCPv6 REPLY: Sorry, no address could be allocated.

DigitalDJ avatar Nov 17 '25 13:11 DigitalDJ

Config looks like

debug
allowinterfaces em0 em2
persistent
script /usr/local/libexec/dhcpcd-run-hooks
timeout 10

noalias
noipv4ll
noarp

anonymous
fqdn disable
duid ll
slaac private
vendorclassid ""
vendclass 1000 ""
require dhcp_server_identifier
option dhcp_lease_time
option rapid_commit
nooption domain_name_servers
nooption domain_search
nooption domain_name
nooption host_name
nooption fqdn
nooption ntp_servers
nooption classless_static_routes
nooption ms_classless_static_routes
nooption static_routes
nooption dhcp6_name_servers
nooption dhcp6_domain_search
nooption dhcp6_fqdn
nooption dhcp6_sntp_servers
nooption dhcp6_ntp_server

interface em2
    gateway
    ipv6rs
    ia_na 0
    iaid 0
interface em0
    nogateway
    noipv6rs
    ia_na 0
    iaid 0

DigitalDJ avatar Nov 17 '25 13:11 DigitalDJ

@athanp is it only SIOCSPFXFLUSH_IN6 that is reporting the error for you? Does it fail to start after that?

Nope, some others too but I'm not now at the lab to give you more details. And yes, it fails to start after that.

athanp avatar Nov 17 '25 15:11 athanp

@DigitalDJ, is there a reason you're using dhcpcd 10.3.0 instead of the version in packages which is 10.2.4? I ask since I plan to update to OpenBSD 7.8 in the next week or two, and I'd like to know if there is an issue with the package version.

zacknewman avatar Nov 17 '25 17:11 zacknewman

@DigitalDJ, is there a reason you're using dhcpcd 10.3.0 instead of the version in packages which is 10.2.4? I ask since I plan to update to OpenBSD 7.8 in the next week or two, and I'd like to know if there is an issue with the package version.

Zero issues with 10.2.4 on 7.8 for the time I was running it.

DigitalDJ avatar Nov 18 '25 03:11 DigitalDJ

@athanp @DigitalDJ Can you test that branch please? Hopefully fixes the issue for you.

NOTE: I cannot replicate this on my FreeBSD-14.3, 15-STABLE or OpenBSD-7.8 vm's.

rsmarples avatar Nov 18 '25 07:11 rsmarples

Yep, I just tested that now. It resolves the issue for OpenBSD 7.8. Thank you!

DigitalDJ avatar Nov 18 '25 08:11 DigitalDJ

Just of note for replication -- I'm not entirely sure what config is different to break it on 7.8, at least for me. I also tried replicating on a fresh install and also couldn't. There's two things I can think of.... I use resflash which mounts a bunch of filesystems RO....or maybe it is because I start dhcpcd quite early in the boot process? I modified /etc/rc to start dhcpcd (instead of OpenBSD's dhcpleased), which means dhcpcd starts before sh /etc/netstart is run. Just some context anyway....

DigitalDJ avatar Nov 18 '25 08:11 DigitalDJ

@rsmarples I confirm that it works fine on FreeBSD 14.3 with no further noticeable issues so far.

athanp avatar Nov 18 '25 18:11 athanp

@athanp , probably worth mentioning, that, while we are waiting for the fix from upstream here, the FreeBSD port was updated to include the patch, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291081

asagratini avatar Nov 19 '25 08:11 asagratini