BOOTP/DHCP client panics

Chris Johns chrisj at rtems.org
Tue Apr 29 01:46:21 UTC 2008


Arnout Vandecappelle wrote:
>  Hoi,
> 
>  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
> change.
> * 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
> error?
> 
>  My personal preference is a combination of the last two, but I'd like
> your input.

The last 2 seem like a suitable approach.

Regards
Chris

> 
>  Regards,
>  Arnout
> 




More information about the users mailing list