diff options
Diffstat (limited to 'net/netlabel')
-rw-r--r-- | net/netlabel/netlabel_addrlist.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/net/netlabel/netlabel_addrlist.c b/net/netlabel/netlabel_addrlist.c index 834c6eb7f484..c0519139679e 100644 --- a/net/netlabel/netlabel_addrlist.c +++ b/net/netlabel/netlabel_addrlist.c | |||
@@ -256,13 +256,11 @@ struct netlbl_af4list *netlbl_af4list_remove(__be32 addr, __be32 mask, | |||
256 | { | 256 | { |
257 | struct netlbl_af4list *entry; | 257 | struct netlbl_af4list *entry; |
258 | 258 | ||
259 | entry = netlbl_af4list_search(addr, head); | 259 | entry = netlbl_af4list_search_exact(addr, mask, head); |
260 | if (entry != NULL && entry->addr == addr && entry->mask == mask) { | 260 | if (entry == NULL) |
261 | netlbl_af4list_remove_entry(entry); | 261 | return NULL; |
262 | return entry; | 262 | netlbl_af4list_remove_entry(entry); |
263 | } | 263 | return entry; |
264 | |||
265 | return NULL; | ||
266 | } | 264 | } |
267 | 265 | ||
268 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 266 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
@@ -299,15 +297,11 @@ struct netlbl_af6list *netlbl_af6list_remove(const struct in6_addr *addr, | |||
299 | { | 297 | { |
300 | struct netlbl_af6list *entry; | 298 | struct netlbl_af6list *entry; |
301 | 299 | ||
302 | entry = netlbl_af6list_search(addr, head); | 300 | entry = netlbl_af6list_search_exact(addr, mask, head); |
303 | if (entry != NULL && | 301 | if (entry == NULL) |
304 | ipv6_addr_equal(&entry->addr, addr) && | 302 | return NULL; |
305 | ipv6_addr_equal(&entry->mask, mask)) { | 303 | netlbl_af6list_remove_entry(entry); |
306 | netlbl_af6list_remove_entry(entry); | 304 | return entry; |
307 | return entry; | ||
308 | } | ||
309 | |||
310 | return NULL; | ||
311 | } | 305 | } |
312 | #endif /* IPv6 */ | 306 | #endif /* IPv6 */ |
313 | 307 | ||