Detecting link state in dhcpc...

Jason Schoon floydpink at gmail.com
Sun Feb 11 02:52:50 UTC 2007


On 2/10/07, Rogelio Serrano <rogelio.serrano at gmail.com> wrote:
>
> On 2/11/07, Denis Vlasenko <vda.linux at googlemail.com> wrote:
> > 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
> > _______________________________________________
> > busybox mailing list
> > busybox at busybox.net
> > http://busybox.net/cgi-bin/mailman/listinfo/busybox
> >
>
> How does the machine find out by itself that you are "just "unplugging
> for 10 seconds and dont want to renew your address?
>
> I would rather have the adapter renew the address anytime the
> interface goes up. And notify the system that the interface is down
> when the link goes down.
>

Agreed, I see nothing wrong with sending a renewal.  It's not like it will
break any of your existing connections.

In my case, I am talking about an embedded device that is essentially
useless if not on a network also, so I definitely want to be able to take
some action if the link goes down as well.  In my case it happens that I
need to do this in static IP case also, so I have a link monitoring daemon
that takes care of it, rather than adding it to DHCP.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20070210/2c5588be/attachment.htm 


More information about the busybox mailing list