diff options
Diffstat (limited to 'net/netlabel/netlabel_unlabeled.c')
-rw-r--r-- | net/netlabel/netlabel_unlabeled.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index 9c38658fba8..e6e823656f9 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * NetLabel system. The NetLabel system manages static and dynamic label | 5 | * NetLabel system. The NetLabel system manages static and dynamic label |
6 | * mappings for network protocols such as CIPSO and RIPSO. | 6 | * mappings for network protocols such as CIPSO and RIPSO. |
7 | * | 7 | * |
8 | * Author: Paul Moore <paul.moore@hp.com> | 8 | * Author: Paul Moore <paul@paul-moore.com> |
9 | * | 9 | * |
10 | */ | 10 | */ |
11 | 11 | ||
@@ -52,7 +52,7 @@ | |||
52 | #include <net/net_namespace.h> | 52 | #include <net/net_namespace.h> |
53 | #include <net/netlabel.h> | 53 | #include <net/netlabel.h> |
54 | #include <asm/bug.h> | 54 | #include <asm/bug.h> |
55 | #include <asm/atomic.h> | 55 | #include <linux/atomic.h> |
56 | 56 | ||
57 | #include "netlabel_user.h" | 57 | #include "netlabel_user.h" |
58 | #include "netlabel_addrlist.h" | 58 | #include "netlabel_addrlist.h" |
@@ -116,8 +116,7 @@ struct netlbl_unlhsh_walk_arg { | |||
116 | * hash table should be okay */ | 116 | * hash table should be okay */ |
117 | static DEFINE_SPINLOCK(netlbl_unlhsh_lock); | 117 | static DEFINE_SPINLOCK(netlbl_unlhsh_lock); |
118 | #define netlbl_unlhsh_rcu_deref(p) \ | 118 | #define netlbl_unlhsh_rcu_deref(p) \ |
119 | rcu_dereference_check(p, rcu_read_lock_held() || \ | 119 | rcu_dereference_check(p, lockdep_is_held(&netlbl_unlhsh_lock)) |
120 | lockdep_is_held(&netlbl_unlhsh_lock)) | ||
121 | static struct netlbl_unlhsh_tbl *netlbl_unlhsh = NULL; | 120 | static struct netlbl_unlhsh_tbl *netlbl_unlhsh = NULL; |
122 | static struct netlbl_unlhsh_iface *netlbl_unlhsh_def = NULL; | 121 | static struct netlbl_unlhsh_iface *netlbl_unlhsh_def = NULL; |
123 | 122 | ||
@@ -426,10 +425,9 @@ int netlbl_unlhsh_add(struct net *net, | |||
426 | audit_info); | 425 | audit_info); |
427 | switch (addr_len) { | 426 | switch (addr_len) { |
428 | case sizeof(struct in_addr): { | 427 | case sizeof(struct in_addr): { |
429 | struct in_addr *addr4, *mask4; | 428 | const struct in_addr *addr4 = addr; |
429 | const struct in_addr *mask4 = mask; | ||
430 | 430 | ||
431 | addr4 = (struct in_addr *)addr; | ||
432 | mask4 = (struct in_addr *)mask; | ||
433 | ret_val = netlbl_unlhsh_add_addr4(iface, addr4, mask4, secid); | 431 | ret_val = netlbl_unlhsh_add_addr4(iface, addr4, mask4, secid); |
434 | if (audit_buf != NULL) | 432 | if (audit_buf != NULL) |
435 | netlbl_af4list_audit_addr(audit_buf, 1, | 433 | netlbl_af4list_audit_addr(audit_buf, 1, |
@@ -440,10 +438,9 @@ int netlbl_unlhsh_add(struct net *net, | |||
440 | } | 438 | } |
441 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 439 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
442 | case sizeof(struct in6_addr): { | 440 | case sizeof(struct in6_addr): { |
443 | struct in6_addr *addr6, *mask6; | 441 | const struct in6_addr *addr6 = addr; |
442 | const struct in6_addr *mask6 = mask; | ||
444 | 443 | ||
445 | addr6 = (struct in6_addr *)addr; | ||
446 | mask6 = (struct in6_addr *)mask; | ||
447 | ret_val = netlbl_unlhsh_add_addr6(iface, addr6, mask6, secid); | 444 | ret_val = netlbl_unlhsh_add_addr6(iface, addr6, mask6, secid); |
448 | if (audit_buf != NULL) | 445 | if (audit_buf != NULL) |
449 | netlbl_af6list_audit_addr(audit_buf, 1, | 446 | netlbl_af6list_audit_addr(audit_buf, 1, |