http://defect.opensolaris.org/bz/show_bug.cgi?id=10653
amaguire <alan.maguire at sun.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |alan.maguire at sun.com
--- Comment #4 from amaguire <alan.maguire at sun.com> 2009-08-14 09:48:10 UTC
---
(In reply to comment #3)
> (In reply to comment #2)
> > The DHCP flag in the ifconfig output does not necessarily mean that
> > the address was acquired from DHCP; the address is not the only
> > configuration data that can be obtained from the DHCP server. Given
> > that there is no dns-nameservice-configsrc value specified for this
> > location, the default value would be used, and the default is to get
> > this information from the DHCP server. Thus nwamd would have initiated
> > a DHCP inform transaction to get that info, which would cause the DHCP
> > flag to be turned on.
> >
> > Bottom line is that the presence of the DHCP flag does not necessarily
> > mean that the address itself was DHCP-assigned; it simply means that a
> > DHCP transaction of some sort has occurred.
>
> Ah, didn't realise that!
>
> So I'm assuming there is no way to validate where the address really came
> from,
> other than to remember what the saved configuration is vs the in-memory
> configuration (which could differ).
I _think_ the right answer here is to do a DHCP_STATUS request via
libdhcpagent. The problem is that libdhcpagent is project-private to ON. In an
ideal world, there would be a libnwam function to request detailed interface
status (addresses configured and sources). Don't know how feasible that is
given the time pressures.
An ugly hack however could possibly make use of the fact that at the moment -
while we only support 1 DHCP interface per-link - DHCP is always configured on
the physical interface (i.e. ath0 rather than the logical ath0:1 etc). Any
static addresses are added as logical interfaces. So (again this is very hacky)
you could conclude that any address that appears on ath0 is from DHCP (provided
that DHCP is an address source for the IP NCU of course).
This will break if a user starts using ifconfig, but as an ugly band-aid it
might just about do it.
As a middleground we could cook up a limited interface status request that
stated whether static/dhcp addresses or both were configured on the link.
nwam_error_t nwam_interface_get_status(const char *linkname, uint64_t
*statusp);
The status flag could be a combination of:
typedef enum {
NWAM_IF_STATUS_DHCP_FAILED = 0x1,
NWAM_IF_STATUS_DHCP_STARTED = 0x2,
NWAM_IF_STATUS_DHCP_ACQUIRED = 0x4,
NWAM_IF_STATUS_STATIC_SET = 0x8
} nwam_if_status_t;
Comments anyone?
--
Configure bugmail: http://defect.opensolaris.org/bz/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.