Detecting link state in dhcpc...

Denis Vlasenko vda.linux at googlemail.com
Sun Feb 11 02:09:32 UTC 2007


On Saturday 10 February 2007 19:35, Jason Schoon wrote:
> > > I recall reading on the list recently that someone was thinking about
> > > modifying dhcpc to do nice things when the link state changes.
> > >
> > > Has this been done?
> > >
> > > If not, I think I will be doing it very soon.
> >
> > Why do you need this?
> >
> > Windows have such a behavior (of severing all TCP connections
> > whenever I need to unplug my network cable for 5 seconds)
> > and it is _awful_.
> >
> > I hope you plan to implement something less annoying then this.
> 
> Perhaps he is talking more along the lines of doing an automatic renewal
> when a link is upped.  For example, plugging into a new network.  You want
> to get a new address on that net, not keep using an old one.  I have
> implemented that several times in different DHCP clients.

Why? If I unplug my machine from network, it does NOT
automatically mean I should renew DHCP address.

It is needed sometimes, but other times (e.g. "I need to unplug
my machine for 10 seconds...") it will be utterly inconvenient.

If you really want it, perhaps kernel sends a hotplug event
or something like it on link down/link up,
so you can hook onto it and kill/restart udhcpc?
--
vda



More information about the busybox mailing list