dhcp6c on ddwrt cannot get new IPv6 routing prefix after PPPoE reconnect

This does not always happen, but rather probabilistic.

I suspect that dhcp6c crashes (or more likely, killed by ddwrt) after PPPoE reconnect, but somehow leaves radvd alive.

It seems that dhcp6c accidentally not marking its listening socket on port 546 (DHCPv6 client) as SOCK_CLOEXEC, and is inherited by radvd.

As radvd is not killed, and inherits dhcp6c‘s listening socket on 546, the newly started (after PPPoE reconnect) dhcp6c cannot get messages, including DHCP6/PD response, from port 546. netstat confirms this:

Usually, 546 should be listened by dhcp6c:

So I wrote a script which manually kill all radvd and dhcp6c instances, and restart dhcp6c manually after sleeping 1 seconds (so that they have really exited.):

I added this script to ddwrt’s firewall command.

Not sure if this helps, though. It still needs more observation.

Leave a Reply

Your email address will not be published.