BOOTP/DHCP client panics
Arnout Vandecappelle
arnout at mind.be
Fri Apr 18 08:43:12 UTC 2008
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.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
Mind Embedded Development (an Essensium division)
More information about the users
mailing list