diff options
-rw-r--r-- | include/linux/netdevice.h | 2 | ||||
-rw-r--r-- | include/net/garp.h | 2 | ||||
-rw-r--r-- | net/802/garp.c | 18 | ||||
-rw-r--r-- | net/802/stp.c | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 4722d4a9b58f..b72d5a460903 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1072,7 +1072,7 @@ struct net_device { | |||
1072 | struct pcpu_dstats __percpu *dstats; /* dummy stats */ | 1072 | struct pcpu_dstats __percpu *dstats; /* dummy stats */ |
1073 | }; | 1073 | }; |
1074 | /* GARP */ | 1074 | /* GARP */ |
1075 | struct garp_port *garp_port; | 1075 | struct garp_port __rcu *garp_port; |
1076 | 1076 | ||
1077 | /* class/net/name entry */ | 1077 | /* class/net/name entry */ |
1078 | struct device dev; | 1078 | struct device dev; |
diff --git a/include/net/garp.h b/include/net/garp.h index 825f172caba9..f4c295984c45 100644 --- a/include/net/garp.h +++ b/include/net/garp.h | |||
@@ -107,7 +107,7 @@ struct garp_applicant { | |||
107 | }; | 107 | }; |
108 | 108 | ||
109 | struct garp_port { | 109 | struct garp_port { |
110 | struct garp_applicant *applicants[GARP_APPLICATION_MAX + 1]; | 110 | struct garp_applicant __rcu *applicants[GARP_APPLICATION_MAX + 1]; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | extern int garp_register_application(struct garp_application *app); | 113 | extern int garp_register_application(struct garp_application *app); |
diff --git a/net/802/garp.c b/net/802/garp.c index 941f2a324d3a..c1df2dad8c6b 100644 --- a/net/802/garp.c +++ b/net/802/garp.c | |||
@@ -346,8 +346,8 @@ int garp_request_join(const struct net_device *dev, | |||
346 | const struct garp_application *appl, | 346 | const struct garp_application *appl, |
347 | const void *data, u8 len, u8 type) | 347 | const void *data, u8 len, u8 type) |
348 | { | 348 | { |
349 | struct garp_port *port = dev->garp_port; | 349 | struct garp_port *port = rtnl_dereference(dev->garp_port); |
350 | struct garp_applicant *app = port->applicants[appl->type]; | 350 | struct garp_applicant *app = rtnl_dereference(port->applicants[appl->type]); |
351 | struct garp_attr *attr; | 351 | struct garp_attr *attr; |
352 | 352 | ||
353 | spin_lock_bh(&app->lock); | 353 | spin_lock_bh(&app->lock); |
@@ -366,8 +366,8 @@ void garp_request_leave(const struct net_device *dev, | |||
366 | const struct garp_application *appl, | 366 | const struct garp_application *appl, |
367 | const void *data, u8 len, u8 type) | 367 | const void *data, u8 len, u8 type) |
368 | { | 368 | { |
369 | struct garp_port *port = dev->garp_port; | 369 | struct garp_port *port = rtnl_dereference(dev->garp_port); |
370 | struct garp_applicant *app = port->applicants[appl->type]; | 370 | struct garp_applicant *app = rtnl_dereference(port->applicants[appl->type]); |
371 | struct garp_attr *attr; | 371 | struct garp_attr *attr; |
372 | 372 | ||
373 | spin_lock_bh(&app->lock); | 373 | spin_lock_bh(&app->lock); |
@@ -546,11 +546,11 @@ static int garp_init_port(struct net_device *dev) | |||
546 | 546 | ||
547 | static void garp_release_port(struct net_device *dev) | 547 | static void garp_release_port(struct net_device *dev) |
548 | { | 548 | { |
549 | struct garp_port *port = dev->garp_port; | 549 | struct garp_port *port = rtnl_dereference(dev->garp_port); |
550 | unsigned int i; | 550 | unsigned int i; |
551 | 551 | ||
552 | for (i = 0; i <= GARP_APPLICATION_MAX; i++) { | 552 | for (i = 0; i <= GARP_APPLICATION_MAX; i++) { |
553 | if (port->applicants[i]) | 553 | if (rtnl_dereference(port->applicants[i])) |
554 | return; | 554 | return; |
555 | } | 555 | } |
556 | rcu_assign_pointer(dev->garp_port, NULL); | 556 | rcu_assign_pointer(dev->garp_port, NULL); |
@@ -565,7 +565,7 @@ int garp_init_applicant(struct net_device *dev, struct garp_application *appl) | |||
565 | 565 | ||
566 | ASSERT_RTNL(); | 566 | ASSERT_RTNL(); |
567 | 567 | ||
568 | if (!dev->garp_port) { | 568 | if (!rtnl_dereference(dev->garp_port)) { |
569 | err = garp_init_port(dev); | 569 | err = garp_init_port(dev); |
570 | if (err < 0) | 570 | if (err < 0) |
571 | goto err1; | 571 | goto err1; |
@@ -601,8 +601,8 @@ EXPORT_SYMBOL_GPL(garp_init_applicant); | |||
601 | 601 | ||
602 | void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl) | 602 | void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl) |
603 | { | 603 | { |
604 | struct garp_port *port = dev->garp_port; | 604 | struct garp_port *port = rtnl_dereference(dev->garp_port); |
605 | struct garp_applicant *app = port->applicants[appl->type]; | 605 | struct garp_applicant *app = rtnl_dereference(port->applicants[appl->type]); |
606 | 606 | ||
607 | ASSERT_RTNL(); | 607 | ASSERT_RTNL(); |
608 | 608 | ||
diff --git a/net/802/stp.c b/net/802/stp.c index 53c8f77f0ccd..978c30b1b36b 100644 --- a/net/802/stp.c +++ b/net/802/stp.c | |||
@@ -21,8 +21,8 @@ | |||
21 | #define GARP_ADDR_MAX 0x2F | 21 | #define GARP_ADDR_MAX 0x2F |
22 | #define GARP_ADDR_RANGE (GARP_ADDR_MAX - GARP_ADDR_MIN) | 22 | #define GARP_ADDR_RANGE (GARP_ADDR_MAX - GARP_ADDR_MIN) |
23 | 23 | ||
24 | static const struct stp_proto *garp_protos[GARP_ADDR_RANGE + 1] __read_mostly; | 24 | static const struct stp_proto __rcu *garp_protos[GARP_ADDR_RANGE + 1] __read_mostly; |
25 | static const struct stp_proto *stp_proto __read_mostly; | 25 | static const struct stp_proto __rcu *stp_proto __read_mostly; |
26 | 26 | ||
27 | static struct llc_sap *sap __read_mostly; | 27 | static struct llc_sap *sap __read_mostly; |
28 | static unsigned int sap_registered; | 28 | static unsigned int sap_registered; |