summaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_device.c8
-rw-r--r--net/bridge/br_fdb.c9
-rw-r--r--net/bridge/br_forward.c2
-rw-r--r--net/bridge/br_if.c2
-rw-r--r--net/bridge/br_input.c63
-rw-r--r--net/bridge/br_ioctl.c2
-rw-r--r--net/bridge/br_notify.c2
-rw-r--r--net/bridge/br_stp.c2
-rw-r--r--net/bridge/br_stp_bpdu.c2
-rw-r--r--net/bridge/br_stp_if.c2
-rw-r--r--net/bridge/br_stp_timer.c2
11 files changed, 58 insertions, 38 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index de14e83a8..d2fac6697 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -5,7 +5,7 @@
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
- * $Id: br_device.c,v 1.1 2000/02/18 16:47:11 davem Exp $
+ * $Id: br_device.c,v 1.2 2000/02/24 19:48:06 davem Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -116,12 +116,10 @@ static int br_dev_stop(struct net_device *dev)
return 0;
}
-#ifdef CONFIG_NET_FASTROUTE
static int br_dev_accept_fastpath(struct net_device *dev, struct dst_entry *dst)
{
return -1;
}
-#endif
void br_dev_setup(struct net_device *dev)
{
@@ -133,9 +131,7 @@ void br_dev_setup(struct net_device *dev)
dev->open = br_dev_open;
dev->set_multicast_list = br_dev_set_multicast_list;
dev->stop = br_dev_stop;
-#ifdef CONFIG_NET_FASTROUTE
dev->accept_fastpath = br_dev_accept_fastpath;
-#endif
-
dev->tx_queue_len = 0;
+ dev->set_mac_address = NULL;
}
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 2ca3c7fdd..be9d1867a 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -5,7 +5,7 @@
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
- * $Id: br_fdb.c,v 1.1 2000/02/18 16:47:12 davem Exp $
+ * $Id: br_fdb.c,v 1.4 2000/02/24 06:16:45 davem Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -14,9 +14,9 @@
*/
#include <linux/kernel.h>
+#include <linux/spinlock.h>
#include <linux/if_bridge.h>
#include <asm/atomic.h>
-#include <asm/spinlock.h>
#include <asm/uaccess.h>
#include "br_private.h"
@@ -216,6 +216,7 @@ int br_fdb_get_entries(struct net_bridge *br,
struct __fdb_entry ent;
int err;
struct net_bridge_fdb_entry *g;
+ struct net_bridge_fdb_entry **pp;
if (has_expired(br, f)) {
f = f->next_hash;
@@ -236,13 +237,13 @@ int br_fdb_get_entries(struct net_bridge *br,
read_lock_bh(&br->hash_lock);
g = f->next_hash;
+ pp = f->pprev_hash;
br_fdb_put(f);
if (err)
goto out_fault;
- if (f->next_hash == NULL &&
- f->pprev_hash == NULL)
+ if (g == NULL && pp == NULL)
goto out_disappeared;
num++;
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index e33850fd2..10e744a2f 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -5,7 +5,7 @@
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
- * $Id: br_forward.c,v 1.1 2000/02/18 16:47:12 davem Exp $
+ * $Id: br_forward.c,v 1.2 2000/02/21 15:51:33 davem Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index cbba5296d..dc77c5ffd 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -5,7 +5,7 @@
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
- * $Id: br_if.c,v 1.1 2000/02/18 16:47:12 davem Exp $
+ * $Id: br_if.c,v 1.2 2000/02/21 15:51:34 davem Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index e3175dac9..e6fa6b379 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -5,7 +5,7 @@
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
- * $Id: br_input.c,v 1.1 2000/02/18 16:47:12 davem Exp $
+ * $Id: br_input.c,v 1.3 2000/02/24 19:48:06 davem Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -23,21 +23,15 @@ unsigned char bridge_ula[5] = { 0x01, 0x80, 0xc2, 0x00, 0x00 };
static void br_pass_frame_up(struct net_bridge *br, struct sk_buff *skb)
{
- if (br->dev.flags & IFF_UP) {
- br->statistics.rx_packets++;
- br->statistics.rx_bytes += skb->len;
-
- skb->dev = &br->dev;
- skb->pkt_type = PACKET_HOST;
- skb->mac.raw = skb->data;
- skb_pull(skb, skb->nh.raw - skb->data);
- skb->protocol = eth_type_trans(skb, &br->dev);
- netif_rx(skb);
-
- return;
- }
-
- kfree_skb(skb);
+ br->statistics.rx_packets++;
+ br->statistics.rx_bytes += skb->len;
+
+ skb->dev = &br->dev;
+ skb->pkt_type = PACKET_HOST;
+ skb->mac.raw = skb->data;
+ skb_pull(skb, skb->nh.raw - skb->data);
+ skb->protocol = eth_type_trans(skb, &br->dev);
+ netif_rx(skb);
}
static void __br_handle_frame(struct sk_buff *skb)
@@ -46,17 +40,44 @@ static void __br_handle_frame(struct sk_buff *skb)
unsigned char *dest;
struct net_bridge_fdb_entry *dst;
struct net_bridge_port *p;
+ int passedup;
skb->nh.raw = skb->mac.raw;
dest = skb->mac.ethernet->h_dest;
p = skb->dev->br_port;
br = p->br;
+ passedup = 0;
+
+ if (!(br->dev.flags & IFF_UP) ||
+ p->state == BR_STATE_DISABLED)
+ goto freeandout;
+
+ if (br->dev.flags & IFF_PROMISC) {
+ struct sk_buff *skb2;
+
+ skb2 = skb_clone(skb, GFP_ATOMIC);
+ if (skb2) {
+ passedup = 1;
+ br_pass_frame_up(br, skb2);
+ }
+ }
- if (p->state == BR_STATE_DISABLED ||
- skb->mac.ethernet->h_source[0] & 1)
+ if (skb->mac.ethernet->h_source[0] & 1)
goto freeandout;
+ if (!passedup &&
+ (dest[0] & 1) &&
+ (br->dev.flags & IFF_ALLMULTI || br->dev.mc_list != NULL)) {
+ struct sk_buff *skb2;
+
+ skb2 = skb_clone(skb, GFP_ATOMIC);
+ if (skb2) {
+ passedup = 1;
+ br_pass_frame_up(br, skb2);
+ }
+ }
+
if (!memcmp(dest, bridge_ula, 5) && !(dest[5] & 0xF0))
goto handle_special_frame;
@@ -71,14 +92,16 @@ static void __br_handle_frame(struct sk_buff *skb)
if (dest[0] & 1) {
br_flood(br, skb, 1);
- br_pass_frame_up(br, skb);
+ if (!passedup)
+ br_pass_frame_up(br, skb);
return;
}
dst = br_fdb_get(br, dest);
if (dst != NULL && dst->is_local) {
- br_pass_frame_up(br, skb);
+ if (!passedup)
+ br_pass_frame_up(br, skb);
br_fdb_put(dst);
return;
}
diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c
index 8830cd747..dad96fb99 100644
--- a/net/bridge/br_ioctl.c
+++ b/net/bridge/br_ioctl.c
@@ -5,7 +5,7 @@
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
- * $Id: br_ioctl.c,v 1.1 2000/02/18 16:47:12 davem Exp $
+ * $Id: br_ioctl.c,v 1.2 2000/02/21 15:51:34 davem Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/net/bridge/br_notify.c b/net/bridge/br_notify.c
index 8a109d7c3..6ed309b75 100644
--- a/net/bridge/br_notify.c
+++ b/net/bridge/br_notify.c
@@ -5,7 +5,7 @@
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
- * $Id: br_notify.c,v 1.1 2000/02/18 16:47:12 davem Exp $
+ * $Id: br_notify.c,v 1.2 2000/02/21 15:51:34 davem Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index a35d03f20..db5c18733 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -5,7 +5,7 @@
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
- * $Id: br_stp.c,v 1.1 2000/02/18 16:47:13 davem Exp $
+ * $Id: br_stp.c,v 1.2 2000/02/21 15:51:34 davem Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c
index 345792f83..71e51ffb2 100644
--- a/net/bridge/br_stp_bpdu.c
+++ b/net/bridge/br_stp_bpdu.c
@@ -5,7 +5,7 @@
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
- * $Id: br_stp_bpdu.c,v 1.1 2000/02/18 16:47:13 davem Exp $
+ * $Id: br_stp_bpdu.c,v 1.2 2000/02/21 15:51:34 davem Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index bbffc4126..263ac21af 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -5,7 +5,7 @@
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
- * $Id: br_stp_if.c,v 1.1 2000/02/18 16:47:13 davem Exp $
+ * $Id: br_stp_if.c,v 1.2 2000/02/21 15:51:34 davem Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
diff --git a/net/bridge/br_stp_timer.c b/net/bridge/br_stp_timer.c
index ca4e6e568..c530f14f8 100644
--- a/net/bridge/br_stp_timer.c
+++ b/net/bridge/br_stp_timer.c
@@ -5,7 +5,7 @@
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
- * $Id: br_stp_timer.c,v 1.1 2000/02/18 16:47:13 davem Exp $
+ * $Id: br_stp_timer.c,v 1.2 2000/02/21 15:51:35 davem Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License