dhcpcd-discuss

Re: Late start for IPv6

Roy Marples

Mon May 05 07:10:15 2014

On 29/04/2014 14:56, Jouke Witteveen wrote:
On Tue, Apr 29, 2014 at 1:09 AM, Roy Marples <roy@xxxxxxxxxxxx> wrote:
On 28/04/2014 22:03, Jouke Witteveen wrote:

In netctl, IPv4 and IPv6 are configured separately. In principle,
users could choose to use a different dhcp client for both versions of
the IP. When netctl goes through the IPv4 configuration stage, it
might start dhcpcd for IPv4. Later, in the IPv6 stage, it might want
to start dhcpcd for IPv6. If the client would have been dhclient in
both cases, this means there will be two instances of dhclient
running. One for the IPv4 address and one for the IPv6 address. These
instances can be tinkered with independently. For dhcpcd, it would be
nice if there was some form of introspection possible to allow IPv6 to
be added to the responsibilities of a running IPv4 instance.

If you find this approach is flawed to begin with, that is okay.


It's a perfectly valid approach if you like a daemon per interface per
protocol.
I personally find that a little bloated, one daemon to manage all interfaces
and protocols :)

The profile-based nature of netctl is actually quite nice and you can
hardly call its source bloated :-).

I was referring to it running seperated daemons per protocol, not netctl itself. I've never seen its code, so I don't have an opinion if it's bloated or not and will have to take your word for it.

However, dhcpcd itself has a rather clean separation of the
implementation on both protocols, so my request might not be too hard
to implement (although I couldn't see a trivial fix).

Yes, it's clean and it's fairly trivial to implement via enabling the
control socket per interface,
but lets consider the command line.

dhcpcd -4 == IPv4 only
dhcpcd -6 == IPv6 only

So, if dhcpcd starts with -4 and is then later called with -6, what is the
expectation?
My expectation is that IPv4 is stopped and IPv6 is started. If you want to
run both protocols then you should use dhcpcd -46.
This keeps consistency with the current control socket implementation.

I was thinking of something like '--extend-functionality-with=ipv6' as
a new parameter.
I believe -46 doesn't work (not tested, just from reading the source),
which is in line with what the man page tells.

You are correct in that -46 doesn't currently work.


Another approach would be to add another option to instruct dhcpcd to use a
different pidfile per protocol.
This is infact the better solution currently because when dhcpcd writes to
it's control socket it returns immediately instead of waiting for the
protocol to be configured.

Or just un-hardcode the pidfile in general. I don't know if dhcpcd
will play nice with multiple instances of itself on the same
interface, but I don't immediately see why it wouldn't.

Yes it will play nice, but then nothing stops you from accidentally launching N copies of itself.
Would netctl be happy with this?

dhcpcd --per-protocol -4 eth0
dhcpcd --per-protocol -6 eth0

dhcpcd --per-protocol -4 -x eth0
dhcpcd --per-protocol -6 -x eth0

Would create the pidfiles:
/var/run/dhcpcd-eth0.pid
/var/run/dhcpcd-eth0.6.pid

That would be fairly trivial to implement.
Let me know

Thanks

Roy

Follow-Ups:
Re: Late start for IPv6Jouke Witteveen
References:
Late start for IPv6Jouke Witteveen
Re: Late start for IPv6Roy Marples
Re: Late start for IPv6Jouke Witteveen
Re: Late start for IPv6Roy Marples
Re: Late start for IPv6Jouke Witteveen
Archive administrator: postmaster@marples.name