Re: dhcpcd -n sets IPv4LL address even if -L is given
Marco Wirz
Tue Jan 07 15:30:42 2014
Hi Roy
Actually, I did submit ticket 307 :-)
At that time, I had not tried versions 6.1 and 6.2 yet, that's why it says version 5.6 there.
I don't run dhcpcd in master mode, and don't use config files for a simple reason: never
change a running system.
It has worked flawlessly with versions 4.0.15 and later 5.6.8 for years.
Only recently did I notice the problem with the IPv4LL addresses.
I did study the code of version 5.6 briefly before submitting the ticket, and noticed that you
do preserve the options DHCPCD_MASTER and DHCPCD_DAEMONISED over a rebind, but lose
the DHCPCD_IPV4LL option. I could probably just add these 2 lines in handle_signal(...)
(haven't tried yet).
But then, I am not sure about side effects, and I assumed you could probably implement the
correct solution within a couple of minutes.
But with your input, I found a workaround:
I create a config file (not /etc/dhcpcd.conf) with only one line: noipv4ll
Then I start dhcpcd with "-f /etc/dhcpcd.conf.ipv4ll" instead of "-L". This only needs minimal
changes to my script, and should I need IPv4LL addresses, I can just omit the -f parameter,
like I currently omit -L in this case.
This way, it is still possible to have one instance with ipv4ll and one instance without ipv4ll
running at the same time on different interfaces.
Thanks
Marco
On Tuesday 07. January 2014 08:51:29 Roy Marples wrote:
> Hi Marco
>
> On 06/01/2014 10:20, Marco Wirz wrote:
> > I have a mobile Linux device with several wired interfaces, some of
> > them running dhcpcd. The interfaces are connected to an external
> > switch and are up, but there is no DHCP server present most of the
> > time.
> >
> > dhcpcd is run without config file as
> >
> > $ dhcpcd -qb4 -L -m 30 -C resolv.conf -C hostname vlan30
> >
> > This works as expected: it waits forever for a DHCP server to appear,
> > and then obtains an IP address.
> >
> > But when I kick dhcpcd before it has obtained an address using
> >
> > $ dhcpcd -n vlan30
> >
> > with still no DHCP server present, the running dhcpcd happily assigns
> > 169.254.X.Y/16 on this interface after a few seconds.
> >
> > I would expect it to never assign IPv4LL addresses when -L was given.
> >
> > Kicking dhcpcd when a DHCP server is present works as expected.
> >
> > Did I miss something?
> >
> > How else can I tell a running dhcpcd to try to get a lease right now,
> > and not wait until the regular retry interval is over? Restarting
> > dhcpcd is not what I have in mind...
>
> This is a known problem.
> http://roy.marples.name/oldprojects/dhcpcd/ticket/307
> (still haven't migrated my tickets across to fossil yet)
>
> Not entirely sure how to solve it because you can change parameters on
> the fly when dhcpcd is running in master mode, which it sounds like you
> are not.
> Assuming this exact problem won't be solved right away, is there a
> reason you don't put your config into dhcpcd.conf?
>
> Thanks
>
> Roy
>
Archive administrator: postmaster@marples.name