> >  > > > > http://cr.opensolaris.org/~meem/dhcp-sock
 > > 
 > > I've updated the webrev to address a few issues found during final
 > > testing.  Specifically:
 > > 
 > >     1. open_ip_lif() no longer assumes that the IP interface is zeroed if
 > >        it's down, and now explicitly calls canonize_lif() to zero it.
 > 
 > Under what conditions was that new call tested?

We ran the DHCP client test suite -- but it was specifically to address
the check_lif() case mentioned below.

 > I ask because canonize_lif() checks for a zero recorded address and
 > just returns rather than touching the interface.

I don't believe that would be a problem.  Suppose the IP interface has a
random assigned address that's down.  If someone starts DHCP, insert_lif()
will load that address into lif_v6addr.  Thus, when open_ip_lif() is later
called it will call verify_lif() which will find lif_v6addr non-zero and
will canonize the interface.

That said, I'm glad you raised this issue because there is indeed a
problem: canonize_lif() also checks whether IFF_DHCPRUNNING is set, and
bails if it's not.  That check doesn't apply in this case but is useful as
a sanity-check when canonize_lif() is called from unplumb_lif(), so I've
added a new argument to canonize_lif() to control its behavior.  I've also
verified that one can indeed acquire a lease on an ipif with a down but
non-zero address, and on an ipif that's up but some other value (we don't
canonize in that case, but it's harmless).

The webrev has been respun.

-- 
meem

Reply via email to