Re: Modularized net bridging PATCH against pre-2.1.104-1

Stefan Traby (stefan@sime.com)
Sun, 24 May 1998 21:04:17 +0200


Hi David !

> > +#elif defined(CONFIG_BRIDGE_MODULE)
> > + if (handle_bridge_hook) (*handle_bridge_hook)(skb,type);
> > #endif
>
> Is this kind of hook permitted?
>
> How many other modules are there that require modular support to be built into
> the kernel? I know the PC Speaker does it, and I assumed that was one of the
> reasons it wasn't accepted.

Funny, I used exact this method for a 2.0.x kernel driver I wrote
(i386/AXP) (hook in net/core/dev.c) and I also (re-)used
"skb->pkt_bridged = IS_BRIDGED" to avoid problems. So loading my module
disables bridging code (and needed bridging compiled in).

I see there no big problem at all, when initializing a hook in init_module
and setting the hook to NULL in cleanup_module.
I like that kinds of hooks, and it doesn't make me nervous at all.

Please give me a simple reason why not to use hooks like this.

But be careful, maybe a reason make me avoid using {,un}register_netdevice,
{add,del}_timer, dynamic proc registration; it's the same game.

-- 
  ciao - 
    Stefan

Stefan Traby phone: +43-3133-6107-2 Mitterlasznitzstr. 13 fax: +43-3133-6107-9 8302 Nestelbach mailto://stefan@sime.com Austria

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu