Dear All,
Please find some patches which may be of use.
They perform :-
1. There appears to be some an issue with the locking code such that if an ethernet packet arrives at the bridging code when the bridge is being built, in that there is a panic. This patch corrects that issue.
2. The bridge hooks and the ATM code are intermingled, this patch moves the bridge hooks out of ATM into the bridge code.
Apologies for it being based upon 2.4.18 and the >>.
Regards
Simon
> > diff -u -r linux-2.4.18/include/linux/if_bridge.h
> > linux-2.4.18ws/include/linux/if_bridge.h
> > --- linux-2.4.18/include/linux/if_bridge.h Thu Nov 22 19:47:12 2001
> > +++ linux-2.4.18ws/include/linux/if_bridge.h Wed Aug 21
16:26:47 2002
> > @@ -104,6 +104,9 @@
> > extern int (*br_ioctl_hook)(unsigned long arg);
> > extern void (*br_handle_frame_hook)(struct sk_buff *skb);
> >
> > +extern struct net_bridge_fdb_entry *(*br_fdb_get_hook)(struct
net_bridge
> > *br,
> > + unsigned char *addr);
> > +extern void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent);
> > #endif
> >
> > #endif
> > diff -u -r linux-2.4.18/net/atm/common.c
linux-2.4.18ws/net/atm/common.c
> > --- linux-2.4.18/net/atm/common.c Fri Nov 9 22:11:15 2001
> > +++ linux-2.4.18ws/net/atm/common.c Wed Aug 21 14:23:55 2002
> > @@ -1139,17 +1139,6 @@
> > }
> > #endif
> >
> > -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
> > -#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
> > -struct net_bridge_fdb_entry *(*br_fdb_get_hook)(struct net_bridge
*br,
> > - unsigned char *addr) =
NULL;
> > -void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent) = NULL;
> > -#if defined(CONFIG_ATM_LANE_MODULE) ||
defined(CONFIG_BRIDGE_MODULE)
> > -EXPORT_SYMBOL(br_fdb_get_hook);
> > -EXPORT_SYMBOL(br_fdb_put_hook);
> > -#endif /* defined(CONFIG_ATM_LANE_MODULE) ||
> defined(CONFIG_BRIDGE_MODULE)
> > */
> > -#endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
*/
> > -
> > void atm_lane_init(void)
> > {
> > #ifndef CONFIG_ATM_LANE_MODULE /* not module */
> > diff -u -r linux-2.4.18/net/bridge/br.c
linux-2.4.18ws/net/bridge/br.c
> > --- linux-2.4.18/net/bridge/br.c Wed Aug 21 18:02:19 2002
> > +++ linux-2.4.18ws/net/bridge/br.c Wed Aug 21 18:13:04 2002
> > @@ -24,9 +24,6 @@
> > #include <asm/uaccess.h>
> > #include "br_private.h"
> >
> > -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
> > -#include "../atm/lec.h"
> > -#endif
> >
> > void br_dec_use_count()
> > {
> > @@ -49,10 +46,8 @@
> >
> > br_handle_frame_hook = br_handle_frame;
> > br_ioctl_hook = br_ioctl_deviceless_stub;
> > -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
> > br_fdb_get_hook = br_fdb_get;
> > br_fdb_put_hook = br_fdb_put;
> > -#endif
> > register_netdevice_notifier(&br_device_notifier);
> >
> > return 0;
> > @@ -76,10 +71,9 @@
> > unregister_netdevice_notifier(&br_device_notifier);
> > br_call_ioctl_atomic(__br_clear_ioctl_hook);
> > net_call_rx_atomic(__br_clear_frame_hook);
> > -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
> > +
> > br_fdb_get_hook = NULL;
> > br_fdb_put_hook = NULL;
> > -#endif
> > }
> >
> > EXPORT_NO_SYMBOLS;
> > diff -u -r linux-2.4.18/net/core/dev.c linux-2.4.18ws/net/core/dev.c
> > --- linux-2.4.18/net/core/dev.c Mon Feb 25 19:38:14 2002
> > +++ linux-2.4.18ws/net/core/dev.c Wed Aug 21 14:30:37 2002
> > @@ -1385,6 +1385,9 @@
> >
> > #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
> > void (*br_handle_frame_hook)(struct sk_buff *skb) = NULL;
> > +struct net_bridge_fdb_entry *(*br_fdb_get_hook)(struct net_bridge
*br,
> > + unsigned char *addr) =
NULL;
> > +void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent) = NULL;
> > #endif
> >
> > static __inline__ int handle_bridge(struct sk_buff *skb,
> > diff -u -r linux-2.4.18/net/netsyms.c linux-2.4.18ws/net/netsyms.c
> > --- linux-2.4.18/net/netsyms.c Mon Feb 25 19:38:14 2002
> > +++ linux-2.4.18ws/net/netsyms.c Wed Aug 21 14:28:37 2002
> > @@ -228,6 +228,8 @@
> >
> > #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
> > EXPORT_SYMBOL(br_handle_frame_hook);
> > +EXPORT_SYMBOL(br_fdb_get_hook);
> > +EXPORT_SYMBOL(br_fdb_put_hook);
> > #ifdef CONFIG_INET
> > EXPORT_SYMBOL(br_ioctl_hook);
> > #endif
> >
> > Second Patch is to correct an invalid lock during bridge creation :-
> >
> > --- net/bridge/br_if.c Thu Sep 19 14:04:30 2002
> > +++ /home/scrowe/linux-2.4.19/net/bridge/br_if.c Mon Feb 25
19:38:14
> > 2002
> > @@ -230,9 +230,9 @@
> > return -ELOOP;
> >
> > dev_hold(dev);
> > - write_lock(&br->lock);
> > + write_lock_bh(&br->lock);
> > if ((p = new_nbp(br, dev)) == NULL) {
> > - write_unlock(&br->lock);
> > + write_unlock_bh(&br->lock);
> > dev_put(dev);
> > return -EXFULL;
> > }
> > @@ -243,7 +243,7 @@
> > br_fdb_insert(br, p, dev->dev_addr, 1);
> > if ((br->dev.flags & IFF_UP) && (dev->flags & IFF_UP))
> > br_stp_enable_port(p);
> > - write_unlock(&br->lock);
> > + write_unlock_bh(&br->lock);
> >
> > return 0;
> > }
> >
