Darren J Moffat writes:
> >   By default, dhcpagent "canonizes" interfaces under its control on
> >   receipt of SIGTERM.  This means that it will reset the IP address
> >   back to 0.0.0.0 during shutdown.  This happens regardless of whether
> >   dhcpagent is configured to release or drop leases.
> 
> I'm sure this was considered but why bother with the reset to 0.0.0.0 on 
> shutdown at all ?  What does it achieve ?

[For what it's worth, someone noted by private email that the word
"canonize" is used quite incorrectly here.  I know.  The code has been
like that for a long time.]

Once we lose the lease, we're required to stop using the address right
away, because it may be assigned to someone else.  When the dhcpagent
daemon exits, though, we lose the ability to take down the address
when required.  We thus tear it down when we can.

Part of the problem is that we have no way of knowing why dhcpagent is
being sent SIGTERM.  It could be that the user just wants that one
service to stop and will wait hours or months before doing anything
else, and we can't leave our address in place.  It could also be that
the system is being shut down, and we can safely just exit, leaving
the address working until the OS halts.

This is what the text refers to in the final section.  This project is
just a short-term fix for the operation of iSCSI with DHCP, and
slightly cleaner and simpler than the one already in place for NFS.
As a separate project, and possibly not a fast-track, someone needs to
look into how DHCP, networking, and SMF all interact.  I think a
better answer in that direction is to make dhcpagent hang around as
long as the lease is in place.  That'll take a fair bit of rework,
though, as we wouldn't want this one service "failing" to exit to
block the shutdown of others on which the service claims dependency
for start-up purposes.

>  If that wasn't done would 
> there be any need for this special knowlege of iSCSI (and NFS) both of 
> which seem very "icky" but if needs must.  What breaks if dhcpagent does 
> not reset back to 0.0.0.0 on shutdown ?

DHCP itself breaks.  The server may reallocate the address, discover
that it's still in use, and end up marking it as permanently
"unusable" due to a conflict.

>  Could it still send the DHCP 
> release to the DHCP server but not reset the interface ?

That's not legal, for the reason given above.  DHCP servers check for
address in use (by ARP and ICMP) before assigning them to clients.

-- 
James Carlson, Solaris Networking              <james.d.carlson at sun.com>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677

Reply via email to