Re: [PATCH 1/2] save duid to lease file

On 02/13/2013 11:36 AM, Dan Williams wrote:
On Wed, 2013-02-13 at 11:16 -0500, Gene Czarcinski wrote:
On 02/13/2013 10:43 AM, Dan Williams wrote:
On Wed, 2013-02-13 at 03:01 -0500, Gene Czarcinski wrote:
get_duid() got a default-duid from the lease file, from
one of the system files, or from the machine-id but did
not save it back to the lease file so that dhclient
could use it.
Signed-off-by: Gene Czarcinski <gene czarc net>
Instead of writing it when getting it, we should actually write it when
we're about to execute dhclient for IPv6.  So something like this
instead?  Good catch though, thanks for looking into this.

Works for me.  Once I turned on logging level=debug and realized that
the DUID had the correct value but that it was never saved, the answer
was obvious.

I believe you will find the other patch equally interesting.  There was
no way to get duid-UUID with uuid_parse().
Yeah, I'd looked at the code for libuuid already.  I saw that it was
ignoring '-' already, which obviously machine-id doesn't have, but I
mentally passed over the strlen() == 36 parts.  I've got that patch and
a cleanup in my tree waiting on some testing and then I'll push.

The code in patch 2 is a "little paranoid" about machine-id being the right length, format , etc. but I noticed that uuid_parse() is pretty paranoid too. I would rather be too paranoid than having the software go off into the weeds with no indication what happened.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]