aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bridge/br.c')
-rw-r--r--net/bridge/br.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/net/bridge/br.c b/net/bridge/br.c
index 12da21afb9ca..654401ceb2db 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -30,36 +30,46 @@ static struct llc_sap *br_stp_sap;
30 30
31static int __init br_init(void) 31static int __init br_init(void)
32{ 32{
33 int err;
34
33 br_stp_sap = llc_sap_open(LLC_SAP_BSPAN, br_stp_rcv); 35 br_stp_sap = llc_sap_open(LLC_SAP_BSPAN, br_stp_rcv);
34 if (!br_stp_sap) { 36 if (!br_stp_sap) {
35 printk(KERN_ERR "bridge: can't register sap for STP\n"); 37 printk(KERN_ERR "bridge: can't register sap for STP\n");
36 return -EBUSY; 38 return -EADDRINUSE;
37 } 39 }
38 40
39 br_fdb_init(); 41 br_fdb_init();
40 42
41#ifdef CONFIG_BRIDGE_NETFILTER 43 err = br_netfilter_init();
42 if (br_netfilter_init()) 44 if (err)
43 return 1; 45 goto err_out1;
44#endif 46
47 err = register_netdevice_notifier(&br_device_notifier);
48 if (err)
49 goto err_out2;
50
51 br_netlink_init();
45 brioctl_set(br_ioctl_deviceless_stub); 52 brioctl_set(br_ioctl_deviceless_stub);
46 br_handle_frame_hook = br_handle_frame; 53 br_handle_frame_hook = br_handle_frame;
47 54
48 br_fdb_get_hook = br_fdb_get; 55 br_fdb_get_hook = br_fdb_get;
49 br_fdb_put_hook = br_fdb_put; 56 br_fdb_put_hook = br_fdb_put;
50 57
51 register_netdevice_notifier(&br_device_notifier);
52
53 return 0; 58 return 0;
59
60err_out2:
61 br_netfilter_fini();
62err_out1:
63 llc_sap_put(br_stp_sap);
64 return err;
54} 65}
55 66
56static void __exit br_deinit(void) 67static void __exit br_deinit(void)
57{ 68{
58 rcu_assign_pointer(br_stp_sap->rcv_func, NULL); 69 rcu_assign_pointer(br_stp_sap->rcv_func, NULL);
59 70
60#ifdef CONFIG_BRIDGE_NETFILTER 71 br_netlink_fini();
61 br_netfilter_fini(); 72 br_netfilter_fini();
62#endif
63 unregister_netdevice_notifier(&br_device_notifier); 73 unregister_netdevice_notifier(&br_device_notifier);
64 brioctl_set(NULL); 74 brioctl_set(NULL);
65 75