On 2014/09/26 07:42, Alexander Hall wrote: > Before performing a dhcp request, /etc/netstart explicitly takes the > interface down. As noted (by me) at g2k14, and also at work, this results > in a significant delay in getting the address. > > I'm not all into enterprise switch magic, but someone hinted that this > could come from the switch reinitializing the port, with all kinds of > spanning-tree magic etc involved.
No magic - it just doesn't forward for a certain number of seconds while it listens for incoming spanning-tree BPDUs. Switch config is dubious though, normally you would use "switchport mode access" and "spanning-tree portfast" or equivalent on access ports. (HP Procurve switches have a different, less intrusive, default where they do listen for BPDUs but only for 3 seconds, so you don't usually need to fiddle with them). > Looking at the history of pre-dhclient ' down' in /etc/netstart > (introduced in -r1.43, 18 Sep 1998 18:42:10), I cannot see a reason > for keeping it. > > This cuts 'sh /etc/netstart' time from ~minute to ~nothing at work. > > OK? Commit log was "apply media directives on dhcp interfaces" - I'm wondering if there may be NICs that only reset media if they are brought down+up. However if that is the case, the user could add 'down' to the hostname.if line themselves.. I think this would only be a problem where you re-run netstart when the system is already up; does that match your experience? > /Alexander > > > Index: netstart > =================================================================== > RCS file: /cvs/src/etc/netstart,v > retrieving revision 1.141 > diff -u -p -r1.141 netstart > --- netstart 12 Jul 2014 14:39:31 -0000 1.141 > +++ netstart 26 Sep 2014 05:32:22 -0000 > @@ -63,7 +63,7 @@ ifstart() { > [ "$name" = "NONE" ] && name= > [ "$mask" = "NONE" ] && mask= > [ "$bcaddr" = "NONE" ] && bcaddr= > - cmd="ifconfig $if $name $mask $bcaddr $ext1 $ext2 down" > + cmd="ifconfig $if $name $mask $bcaddr $ext1 $ext2" > cmd="$cmd;dhclient $if" > dhcpif="$dhcpif $if" > ;; > >