Click: linuxmodule ToDevice initialization

Eddie Kohler kohler at aciri.org
Thu Aug 16 11:27:39 EDT 2001


Hi Kyle,

Hmm. This is a little bit confusing to me, even with your helpful
description of the problem (thanks!).

> What happens is that before ToDevice::initialize ever gets called,
> todev_static_initialize runs, calling register_netdevice_notifier,
> passing it the address of device_notifier_hook.  Soon after that, linux
> calls device_notifier_hook with NETDEV_UP.
> 
> It seems that ToDevice::initialize needs to run before that happens,
> because initialize sets up an unknown mapping in to_device_map that gets
> filled in when linux calls device_notifier_hook.

Well, there is a race condition between configure() and initialize() for
ToDevice (and probably for the others).

Oh -- found it!! Code in anydevice.cc was holding the device, but dropping
the pointer if the device was down (WITHOUT calling dev_put). I've checked
in a fix. Does this help you?

l,d



More information about the click mailing list