Re: [PATCH] Fix manual IP config



On Tue, 2008-03-18 at 11:37 +0100, Helmut Schaa wrote:
> Am Montag, 17. März 2008 18:06:18 schrieb Tambet Ingo:
> > On Mon, Mar 17, 2008 at 11:02 AM, Helmut Schaa <hschaa suse de> wrote:
> > >  Why not call it in real_act_stage3_ip_config_start as it is done when
> > > using DHCP? That would be much clearer, no?
> >
> > It's much cleaner to not keep dhcp manager around when a device is
> > deactivated. It's not only cleaner, it's a bug not to do it there.
> 
> The decision is up to you :)
> 
> Nevertheless I want to give you an hypothetical scenario why I would prefer it 
> to be set in real_act_stage3_ip_config_start:
> 
> As far as I can see nm_device_set_use_dhcp is defined in nm_device.h and could 
> therefore be used from some places outside nm_device.cpp. It would be 
> possible to call nm_device_set_use_dhcp even if the device is down. 
> Afterwards starting a non-dhcp connection on that device would lead to the 
> initial problem. Setting it in real_act_stage3_ip_config_start would avoid 
> such issues.

Seems kind of odd; I can't think why we'd want to set it when the device
is down?  The use-dhcp parameter should _only_ be set during activation,
based on the 'method' parameter of the activating connection's
ip4-config setting.  When the activation cancels, or the device is
deactivated, the use-dhcp setting should be cleared, because the next
time the device activates, it might have a different connection, and
therefore have a different 'method' parameter in the ip4-config setting,
and therefore use autoipv4 or static addressing instead of DHCP.

Dan




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