aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-08 10:55:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-08 10:55:01 -0500
commitd7fc02c7bae7b1cf69269992cf880a43a350cdaa (patch)
treea43d56fa72913a1cc98a0bbebe054d08581b3a7c /net/bridge
parentee1262dbc65ce0b6234a915d8432171e8d77f518 (diff)
parent28b4d5cc17c20786848cdc07b7ea237a309776bb (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1815 commits) mac80211: fix reorder buffer release iwmc3200wifi: Enable wimax core through module parameter iwmc3200wifi: Add wifi-wimax coexistence mode as a module parameter iwmc3200wifi: Coex table command does not expect a response iwmc3200wifi: Update wiwi priority table iwlwifi: driver version track kernel version iwlwifi: indicate uCode type when fail dump error/event log iwl3945: remove duplicated event logging code b43: fix two warnings ipw2100: fix rebooting hang with driver loaded cfg80211: indent regulatory messages with spaces iwmc3200wifi: fix NULL pointer dereference in pmkid update mac80211: Fix TX status reporting for injected data frames ath9k: enable 2GHz band only if the device supports it airo: Fix integer overflow warning rt2x00: Fix padding bug on L2PAD devices. WE: Fix set events not propagated b43legacy: avoid PPC fault during resume b43: avoid PPC fault during resume tcp: fix a timewait refcnt race ... Fix up conflicts due to sysctl cleanups (dead sysctl_check code and CTL_UNNUMBERED removed) in kernel/sysctl_check.c net/ipv4/sysctl_net_ipv4.c net/ipv6/addrconf.c net/sctp/sysctl.c
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_device.c1
-rw-r--r--net/bridge/br_fdb.c4
-rw-r--r--net/bridge/br_if.c23
-rw-r--r--net/bridge/br_ioctl.c4
-rw-r--r--net/bridge/br_sysfs_br.c6
-rw-r--r--net/bridge/netfilter/ebt_stp.c4
6 files changed, 23 insertions, 19 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 07a07770c8b6..1a99c4e04e85 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -157,6 +157,7 @@ static const struct ethtool_ops br_ethtool_ops = {
157 .get_tso = ethtool_op_get_tso, 157 .get_tso = ethtool_op_get_tso,
158 .set_tso = br_set_tso, 158 .set_tso = br_set_tso,
159 .get_ufo = ethtool_op_get_ufo, 159 .get_ufo = ethtool_op_get_ufo,
160 .set_ufo = ethtool_op_set_ufo,
160 .get_flags = ethtool_op_get_flags, 161 .get_flags = ethtool_op_get_flags,
161}; 162};
162 163
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 57bf05c353bc..3b8e038ab32c 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -60,8 +60,8 @@ static inline unsigned long hold_time(const struct net_bridge *br)
60static inline int has_expired(const struct net_bridge *br, 60static inline int has_expired(const struct net_bridge *br,
61 const struct net_bridge_fdb_entry *fdb) 61 const struct net_bridge_fdb_entry *fdb)
62{ 62{
63 return !fdb->is_static 63 return !fdb->is_static &&
64 && time_before_eq(fdb->ageing_timer + hold_time(br), jiffies); 64 time_before_eq(fdb->ageing_timer + hold_time(br), jiffies);
65} 65}
66 66
67static inline int br_mac_hash(const unsigned char *mac) 67static inline int br_mac_hash(const unsigned char *mac)
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 4a9f52732655..a2cbe61f6e65 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -154,7 +154,7 @@ static void del_nbp(struct net_bridge_port *p)
154} 154}
155 155
156/* called with RTNL */ 156/* called with RTNL */
157static void del_br(struct net_bridge *br) 157static void del_br(struct net_bridge *br, struct list_head *head)
158{ 158{
159 struct net_bridge_port *p, *n; 159 struct net_bridge_port *p, *n;
160 160
@@ -165,7 +165,7 @@ static void del_br(struct net_bridge *br)
165 del_timer_sync(&br->gc_timer); 165 del_timer_sync(&br->gc_timer);
166 166
167 br_sysfs_delbr(br->dev); 167 br_sysfs_delbr(br->dev);
168 unregister_netdevice(br->dev); 168 unregister_netdevice_queue(br->dev, head);
169} 169}
170 170
171static struct net_device *new_bridge_dev(struct net *net, const char *name) 171static struct net_device *new_bridge_dev(struct net *net, const char *name)
@@ -323,7 +323,7 @@ int br_del_bridge(struct net *net, const char *name)
323 } 323 }
324 324
325 else 325 else
326 del_br(netdev_priv(dev)); 326 del_br(netdev_priv(dev), NULL);
327 327
328 rtnl_unlock(); 328 rtnl_unlock();
329 return ret; 329 return ret;
@@ -390,6 +390,10 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
390 if (dev->br_port != NULL) 390 if (dev->br_port != NULL)
391 return -EBUSY; 391 return -EBUSY;
392 392
393 /* No bridging devices that dislike that (e.g. wireless) */
394 if (dev->priv_flags & IFF_DONT_BRIDGE)
395 return -EOPNOTSUPP;
396
393 p = new_nbp(br, dev); 397 p = new_nbp(br, dev);
394 if (IS_ERR(p)) 398 if (IS_ERR(p))
395 return PTR_ERR(p); 399 return PTR_ERR(p);
@@ -466,15 +470,14 @@ int br_del_if(struct net_bridge *br, struct net_device *dev)
466void br_net_exit(struct net *net) 470void br_net_exit(struct net *net)
467{ 471{
468 struct net_device *dev; 472 struct net_device *dev;
473 LIST_HEAD(list);
469 474
470 rtnl_lock(); 475 rtnl_lock();
471restart: 476 for_each_netdev(net, dev)
472 for_each_netdev(net, dev) { 477 if (dev->priv_flags & IFF_EBRIDGE)
473 if (dev->priv_flags & IFF_EBRIDGE) { 478 del_br(netdev_priv(dev), &list);
474 del_br(netdev_priv(dev)); 479
475 goto restart; 480 unregister_netdevice_many(&list);
476 }
477 }
478 rtnl_unlock(); 481 rtnl_unlock();
479 482
480} 483}
diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c
index 6a6433daaf27..2af6e4a90262 100644
--- a/net/bridge/br_ioctl.c
+++ b/net/bridge/br_ioctl.c
@@ -81,6 +81,7 @@ static int get_fdb_entries(struct net_bridge *br, void __user *userbuf,
81 return num; 81 return num;
82} 82}
83 83
84/* called with RTNL */
84static int add_del_if(struct net_bridge *br, int ifindex, int isadd) 85static int add_del_if(struct net_bridge *br, int ifindex, int isadd)
85{ 86{
86 struct net_device *dev; 87 struct net_device *dev;
@@ -89,7 +90,7 @@ static int add_del_if(struct net_bridge *br, int ifindex, int isadd)
89 if (!capable(CAP_NET_ADMIN)) 90 if (!capable(CAP_NET_ADMIN))
90 return -EPERM; 91 return -EPERM;
91 92
92 dev = dev_get_by_index(dev_net(br->dev), ifindex); 93 dev = __dev_get_by_index(dev_net(br->dev), ifindex);
93 if (dev == NULL) 94 if (dev == NULL)
94 return -EINVAL; 95 return -EINVAL;
95 96
@@ -98,7 +99,6 @@ static int add_del_if(struct net_bridge *br, int ifindex, int isadd)
98 else 99 else
99 ret = br_del_if(br, dev); 100 ret = br_del_if(br, dev);
100 101
101 dev_put(dev);
102 return ret; 102 return ret;
103} 103}
104 104
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index ee4820aa1843..bee4f300d0c8 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -316,9 +316,9 @@ static ssize_t store_group_addr(struct device *d,
316 if (new_addr[5] & ~0xf) 316 if (new_addr[5] & ~0xf)
317 return -EINVAL; 317 return -EINVAL;
318 318
319 if (new_addr[5] == 1 /* 802.3x Pause address */ 319 if (new_addr[5] == 1 || /* 802.3x Pause address */
320 || new_addr[5] == 2 /* 802.3ad Slow protocols */ 320 new_addr[5] == 2 || /* 802.3ad Slow protocols */
321 || new_addr[5] == 3) /* 802.1X PAE address */ 321 new_addr[5] == 3) /* 802.1X PAE address */
322 return -EINVAL; 322 return -EINVAL;
323 323
324 spin_lock_bh(&br->lock); 324 spin_lock_bh(&br->lock);
diff --git a/net/bridge/netfilter/ebt_stp.c b/net/bridge/netfilter/ebt_stp.c
index 48527e621626..75e29a9cebda 100644
--- a/net/bridge/netfilter/ebt_stp.c
+++ b/net/bridge/netfilter/ebt_stp.c
@@ -135,8 +135,8 @@ ebt_stp_mt(const struct sk_buff *skb, const struct xt_match_param *par)
135 if (memcmp(sp, header, sizeof(header))) 135 if (memcmp(sp, header, sizeof(header)))
136 return false; 136 return false;
137 137
138 if (info->bitmask & EBT_STP_TYPE 138 if (info->bitmask & EBT_STP_TYPE &&
139 && FWINV(info->type != sp->type, EBT_STP_TYPE)) 139 FWINV(info->type != sp->type, EBT_STP_TYPE))
140 return false; 140 return false;
141 141
142 if (sp->type == BPDU_TYPE_CONFIG && 142 if (sp->type == BPDU_TYPE_CONFIG &&