[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
BOOTP/DHCP client panics
- Date: Tue, 29 Apr 2008 11:46:21 +1000
- From: chrisj at rtems.org (Chris Johns)
- Subject: BOOTP/DHCP client panics
Arnout Vandecappelle wrote:
> Still struggling to get DHCP to re-acquire an address when migrating to
> another network...
> In my network driver, I've implemented the IFF_RUNNING flags the way I
> think it is supposed to be: the IFF_RUNNING flag is only on when the
> Ethernet interface is able to send and receive packets, i.e. the chip
> has booted and the cable is plugged in. I've implemented the booting of
> the Ethernet chip asynchronously, i.e. rtems_bsdnet_initialize_network
> () returns before the Ethernet chip is ready, because this takes up to 2
> seconds and that's too long for the rest of the application to wait.
> However, bootpc_call() does a sosend() on the interface immediately.
> This is fine, except that sosend() returns ENETDOWN because the
> interface isn't running. bootpc_call() therefore gives up.
> dhcp_init(), when it detects the failed bootpc_call(), issues a panic!
> Clearly, this behaviour is undesirable. My question is, what should I
> * Make my driver set the IFF_RUNNING flag even if it isn't running?
> * Change bootpc_call() so it doesn't give up on sosend() error, but just
> tries again (like it does when it doesn't receive a reply)?
> * Change dhcp_init() so it doesn't panic when bootpc_call() returns an
> My personal preference is a combination of the last two, but I'd like
> your input.
The last 2 seem like a suitable approach.