summaryrefslogtreecommitdiffstats
path: root/net/bridge/br.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-07-05 21:25:56 -0700
committerDavid S. Miller <davem@davemloft.net>2008-07-05 21:25:56 -0700
commit7c85fbf0657f216557b0c9c4a2e4e07f37d8bb8c (patch)
tree08660067a7f60fdf4e8343ec9481ce6da22ac6d8 /net/bridge/br.c
parenta19800d704177caaa5874baf5819307c5b7d5e4f (diff)
downloadop-kernel-dev-7c85fbf0657f216557b0c9c4a2e4e07f37d8bb8c.zip
op-kernel-dev-7c85fbf0657f216557b0c9c4a2e4e07f37d8bb8c.tar.gz
bridge: Use STP demux
Use the STP demux layer for receiving STP PDUs instead of directly registering with LLC. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br.c')
-rw-r--r--net/bridge/br.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/net/bridge/br.c b/net/bridge/br.c
index cede010..573acdf 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -18,21 +18,24 @@
#include <linux/init.h>
#include <linux/llc.h>
#include <net/llc.h>
+#include <net/stp.h>
#include "br_private.h"
int (*br_should_route_hook)(struct sk_buff *skb);
-static struct llc_sap *br_stp_sap;
+static const struct stp_proto br_stp_proto = {
+ .rcv = br_stp_rcv,
+};
static int __init br_init(void)
{
int err;
- br_stp_sap = llc_sap_open(LLC_SAP_BSPAN, br_stp_rcv);
- if (!br_stp_sap) {
+ err = stp_proto_register(&br_stp_proto);
+ if (err < 0) {
printk(KERN_ERR "bridge: can't register sap for STP\n");
- return -EADDRINUSE;
+ return err;
}
err = br_fdb_init();
@@ -65,13 +68,13 @@ err_out2:
err_out1:
br_fdb_fini();
err_out:
- llc_sap_put(br_stp_sap);
+ stp_proto_unregister(&br_stp_proto);
return err;
}
static void __exit br_deinit(void)
{
- rcu_assign_pointer(br_stp_sap->rcv_func, NULL);
+ stp_proto_unregister(&br_stp_proto);
br_netlink_fini();
unregister_netdevice_notifier(&br_device_notifier);
@@ -82,7 +85,6 @@ static void __exit br_deinit(void)
synchronize_net();
br_netfilter_fini();
- llc_sap_put(br_stp_sap);
br_fdb_get_hook = NULL;
br_fdb_put_hook = NULL;
OpenPOWER on IntegriCloud