32 #include <linux/types.h>
34 #include <linux/list.h>
37 #include <linux/in6.h>
39 #include <linux/ipv6.h>
42 #include <linux/audit.h>
66 list_for_each_entry_rcu(iter, head,
list)
91 list_for_each_entry_rcu(iter, head,
list)
99 #if IS_ENABLED(CONFIG_IPV6)
116 list_for_each_entry_rcu(iter, head,
list)
118 ipv6_masked_addr_cmp(&iter->addr, &iter->
mask, addr) == 0)
142 list_for_each_entry_rcu(iter, head,
list)
144 ipv6_addr_equal(&iter->addr, addr) &&
145 ipv6_addr_equal(&iter->mask, mask))
176 list_for_each_entry_rcu(iter, head,
list)
184 list_add_tail_rcu(&entry->
list, head);
188 #if IS_ENABLED(CONFIG_IPV6)
204 iter = netlbl_af6list_search(&entry->
addr, head);
206 ipv6_addr_equal(&iter->
addr, &entry->
addr) &&
207 ipv6_addr_equal(&iter->
mask, &entry->
mask))
214 list_for_each_entry_rcu(iter, head,
list)
216 ipv6_addr_cmp(&entry->mask, &iter->mask) > 0) {
222 list_add_tail_rcu(&entry->
list, head);
239 list_del_rcu(&entry->
list);
266 #if IS_ENABLED(CONFIG_IPV6)
279 list_del_rcu(&entry->
list);
300 entry = netlbl_af6list_search_exact(addr, mask, head);
303 netlbl_af6list_remove_entry(entry);
325 void netlbl_af4list_audit_addr(
struct audit_buffer *audit_buf,
330 char *
dir = (src ?
"src" :
"dst");
335 if (mask_val != 0xffffffff) {
337 while (mask_val > 0) {
345 #if IS_ENABLED(CONFIG_IPV6)
358 void netlbl_af6list_audit_addr(
struct audit_buffer *audit_buf,
364 char *dir = (src ?
"src" :
"dst");
369 if (
ntohl(mask->s6_addr32[3]) != 0xffffffff) {
373 while (
ntohl(mask->s6_addr32[++iter]) == 0xffffffff)
375 mask_val =
ntohl(mask->s6_addr32[iter]);
376 while (mask_val > 0) {