On 07/12/15(Mon) 18:43, Reyk Floeter wrote: > On Mon, Dec 07, 2015 at 06:15:43PM +0100, Martin Pieuchot wrote: > > On 07/12/15(Mon) 18:17, Reyk Floeter wrote: > > > On Mon, Dec 07, 2015 at 04:56:56PM +0100, Martin Pieuchot wrote: > > > > If for some reason SIOCAIFADDR fails, exit instead of hanging. > > > > > > > > Without this diff I need to kill dhclient(8) with ctrl+C during boot > > > > if I happen to have the address offered by the server configured on > > > > a different interface. > > > > > > > > WARNING: do not try to do that on -current without my rt_delete diffs > > > > or your kernel with panic! > > > > > > > > Ok? > > > > > > > > > > Why don't you reject the address, go into background and try again > > > later? > > > > Because if SIOCAIFADDR fails it means that you're doing something > > stupid so there's no point in retrying later. > > So what does it mean? You have two dhcp interfaces connected to the > same VLAN? Are you doing something stupid on the local machine, the > dhcp server, or the outside network?
The local machine. SIOCAIFADDR failing means you're trying to configure the same address twice. It's like doing: # ifconfig em0 192.168.0.1 # ifconfig em1 192.168.0.1 The second ifconfig bails with EEXIST, just like dhclient in the case I describe. > You wouldn't believe me how much stupidity is found in data centers > where you run your otherwise perfectly configured OpenBSD machines. > For example, primary switch fails, backup takes over, but with a > broken configuration ... Ah, and please don't forget about SDN where > everything is dynamic and talks to some Linux-driven, Java- or Python > based controllers. > > I don't think that dhclient should every hard fail for network- > related errors. I agree, but here we're not talking about network related error.
