Re: [PATCH] Ethernet bridging fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



   From: Stephen Hemminger <shemminger@osdl.org>
   Date: 20 Mar 2003 11:44:16 -0800

I disagree with this change:

   diff -Nru a/net/bridge/br.c b/net/bridge/br.c
   --- a/net/bridge/br.c	Thu Mar 20 11:29:45 2003
   +++ b/net/bridge/br.c	Thu Mar 20 11:29:45 2003
   @@ -60,18 +60,13 @@
    	return 0;
    }
    
   -static void __br_clear_ioctl_hook(void)
   -{
   -	br_ioctl_hook = NULL;
   -}
   -
    static void __exit br_deinit(void)
    {
    #ifdef CONFIG_NETFILTER
    	br_netfilter_fini();
    #endif
    	unregister_netdevice_notifier(&br_device_notifier);
   -	br_call_ioctl_atomic(__br_clear_ioctl_hook);
   +	br_ioctl_hook = NULL;
    
    	br_write_lock_bh(BR_NETPROTO_LOCK);
    	br_handle_frame_hook = NULL;

Sure, the br_call_ioctl_atomic() wasn't really protecting
the right thing, but that doesn't mean that you are allowed
to remove this and totally ignore the problem altogether.

What really needs to happen is to move the br_ioctl.c:ioctl_mutex
next to br_ioctl_hook in net/socket.c, renaming it to br_ioctl_mutex
and take this semaphore around any reference there to br_ioctl_hook.

Then you take this semaphore when NULL'ing out br_ioctl_hook.

Don't forget to export the br_ioctl_mutex symbol to modules.

The rest of your patch looks fine.
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux