aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_if.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-20 20:43:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-20 20:43:29 -0400
commitdb6d8c7a4027b48d797b369a53f8470aaeed7063 (patch)
treee140c104a89abc2154e1f41a7db8ebecbb6fa0b4 /net/bridge/br_if.c
parent3a533374283aea50eab3976d8a6d30532175f009 (diff)
parentfb65a7c091529bfffb1262515252c0d0f6241c5c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (1232 commits) iucv: Fix bad merging. net_sched: Add size table for qdiscs net_sched: Add accessor function for packet length for qdiscs net_sched: Add qdisc_enqueue wrapper highmem: Export totalhigh_pages. ipv6 mcast: Omit redundant address family checks in ip6_mc_source(). net: Use standard structures for generic socket address structures. ipv6 netns: Make several "global" sysctl variables namespace aware. netns: Use net_eq() to compare net-namespaces for optimization. ipv6: remove unused macros from net/ipv6.h ipv6: remove unused parameter from ip6_ra_control tcp: fix kernel panic with listening_get_next tcp: Remove redundant checks when setting eff_sacks tcp: options clean up tcp: Fix MD5 signatures for non-linear skbs sctp: Update sctp global memory limit allocations. sctp: remove unnecessary byteshifting, calculate directly in big-endian sctp: Allow only 1 listening socket with SO_REUSEADDR sctp: Do not leak memory on multiple listen() calls sctp: Support ipv6only AF_INET6 sockets. ...
Diffstat (limited to 'net/bridge/br_if.c')
-rw-r--r--net/bridge/br_if.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index f38cc5317b88..a072ea5ca6f5 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -5,8 +5,6 @@
5 * Authors: 5 * Authors:
6 * Lennert Buytenhek <buytenh@gnu.org> 6 * Lennert Buytenhek <buytenh@gnu.org>
7 * 7 *
8 * $Id: br_if.c,v 1.7 2001/12/24 00:59:55 davem Exp $
9 *
10 * This program is free software; you can redistribute it and/or 8 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 9 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 10 * as published by the Free Software Foundation; either version
@@ -375,6 +373,10 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
375 if (IS_ERR(p)) 373 if (IS_ERR(p))
376 return PTR_ERR(p); 374 return PTR_ERR(p);
377 375
376 err = dev_set_promiscuity(dev, 1);
377 if (err)
378 goto put_back;
379
378 err = kobject_init_and_add(&p->kobj, &brport_ktype, &(dev->dev.kobj), 380 err = kobject_init_and_add(&p->kobj, &brport_ktype, &(dev->dev.kobj),
379 SYSFS_BRIDGE_PORT_ATTR); 381 SYSFS_BRIDGE_PORT_ATTR);
380 if (err) 382 if (err)
@@ -389,7 +391,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
389 goto err2; 391 goto err2;
390 392
391 rcu_assign_pointer(dev->br_port, p); 393 rcu_assign_pointer(dev->br_port, p);
392 dev_set_promiscuity(dev, 1); 394 dev_disable_lro(dev);
393 395
394 list_add_rcu(&p->list, &br->port_list); 396 list_add_rcu(&p->list, &br->port_list);
395 397
@@ -413,12 +415,12 @@ err2:
413 br_fdb_delete_by_port(br, p, 1); 415 br_fdb_delete_by_port(br, p, 1);
414err1: 416err1:
415 kobject_del(&p->kobj); 417 kobject_del(&p->kobj);
416 goto put_back;
417err0: 418err0:
418 kobject_put(&p->kobj); 419 kobject_put(&p->kobj);
419 420 dev_set_promiscuity(dev, -1);
420put_back: 421put_back:
421 dev_put(dev); 422 dev_put(dev);
423 kfree(p);
422 return err; 424 return err;
423} 425}
424 426