From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Larmour To: Hugo Tyson Cc: ecos-discuss@sources.redhat.com Subject: Re: [ECOS] DHCP shuts down Ethernet device? Date: Mon, 23 Apr 2001 12:27:00 -0000 Message-id: <3AE4822A.24EC454B@redhat.com> References: <20010423123926.A2035@visi.com> X-SW-Source: 2001-04/msg00335.html Hugo Tyson wrote: > > Grant Edwards writes: > > I just discovered that when the DHCP task fails to find a > > server, it then shuts down the Ethernet driver using the code: > > > > // Shut down interface so it can be reinitialized > > ifr.ifr_flags &= ~(IFF_UP | IFF_RUNNING); > > if (ioctl(s, SIOCSIFFLAGS, &ifr)) { /* set ifnet flags */ > > perror("SIOCSIFFLAGS down"); > > return false; > > } > > > > This generates a call to the _stop() method in the Ethernet > > driver. > > > > I realise that if DHCP fails, the IP stack needs to be shut > > down, but stopping the ethernet device entirely keeps non-IP > > stuff from working. Does the DHCP code assume that there are > > no non-IP network protocols, or is the above supposed to shut > > down only IP networking on the device? The other drivers I've > > looked at all seem to shut off the interface completely. > > It shuts down everything, deliberately. > > > I think I'm going to have to either comment out the above call, > > or make my Ethernet driver's _stop() method into a noop... > > Either of those would do. I'm wondering: isn't the problem just that configuring the interface down calls the _stop() method? Why not just not do that? The common eth driver already just has eth_drv_recv() return immediately if the interface is down. Of course it depends where any non-TCP/IP stack is plugging in... It probably shouldn't be the default behaviour admittedly, otherwise we're just doing a bunch of interrupt processing for no reason in the most common case. Jifl -- Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062 Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine