On Mon, Mar 15, 2010 at 12:39:52PM -0400, Anurag Maskey wrote: > > In > usr/src/cmd/cmd-inet/lib/nwamd/routing_events.c:routing_events_v4(), > no IF_STATE events are generated for any routing socket messages if > the address is 0.0.0.0. > > However, in ncu_ip.c:nwamd_ncu_handle_if_state_event(), there is > code for a bug workaround that checks the address on the interface > if the routing socket message was a DELADDR/FREEADDR for 0.0.0.0.
Based on the bug description, this code seems to be dealing with the fact that dhcpagent may fall back to a previously-obtained lease if it is unable to communicate with the dhcp server, and the lease has not expired. So an interface plumbed over an unconnected link can end up getting an address assigned; this results in some fairly confusing routing socket messages, including this one. Since nwamd knows the link is really down, it's trying to just remove the address here. [...] > This code is never executed in nwamd_ncu_handle_if_state_event(). > Is this code necessary? If so, it should be moved to > routing_events_v4(). I think it probably is still needed, assuming the bug still exists. > Another reason I ask this question is that libipadm does not allow > the setting of 0.0.0.0 address. The only this that can be done here > (after consulting with libipadm expert Girish) is > ipadm_delete_addr() followed by ipadm_create_addr() with a DHCP > address. If the DHCP server is not available (which appears to be > the case here since the comments suggest that the datalink is down), > then the 0.0.0.0 address will be set on the interface while trying > to get the DHCP address and lease. Is this the intended behavior > for such a scenario? I would think simply removing the address that dhcpagent assigned (from the old lease) would be sufficient. -renee
