patch-2.4.22 linux-2.4.22/net/bridge/br_fdb.c
Next file: linux-2.4.22/net/bridge/br_if.c
Previous file: linux-2.4.22/net/bluetooth/syms.c
Back to the patch index
Back to the overall index
- Lines: 46
- Date:
2003-08-25 04:44:44.000000000 -0700
- Orig file:
linux-2.4.21/net/bridge/br_fdb.c
- Orig date:
2002-02-25 11:38:14.000000000 -0800
diff -urN linux-2.4.21/net/bridge/br_fdb.c linux-2.4.22/net/bridge/br_fdb.c
@@ -292,21 +292,30 @@
write_lock_bh(&br->hash_lock);
fdb = br->hash[hash];
while (fdb != NULL) {
- if (!fdb->is_local &&
- !memcmp(fdb->addr.addr, addr, ETH_ALEN)) {
+ if (!memcmp(fdb->addr.addr, addr, ETH_ALEN)) {
+ /* attempt to update an entry for a local interface */
+ if (fdb->is_local) {
+ if (is_local)
+ printk(KERN_INFO "%s: attempt to add"
+ " interface with same source address.\n",
+ source->dev->name);
+ else if (net_ratelimit())
+ printk(KERN_WARNING "%s: received packet with "
+ " own address as source address\n",
+ source->dev->name);
+ goto out;
+ }
+
__fdb_possibly_replace(fdb, source, is_local);
- write_unlock_bh(&br->hash_lock);
- return;
+ goto out;
}
fdb = fdb->next_hash;
}
fdb = kmalloc(sizeof(*fdb), GFP_ATOMIC);
- if (fdb == NULL) {
- write_unlock_bh(&br->hash_lock);
- return;
- }
+ if (fdb == NULL)
+ goto out;
memcpy(fdb->addr.addr, addr, ETH_ALEN);
atomic_set(&fdb->use_count, 1);
@@ -317,5 +326,6 @@
__hash_link(br, fdb, hash);
+ out:
write_unlock_bh(&br->hash_lock);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)