307 |
} |
} |
308 |
|
|
309 |
/** |
/** |
310 |
* ccs_address_matches_to_group - Check whether the given address matches members of the given address group. |
* ccs_address_matches_group - Check whether the given address matches members of the given address group. |
311 |
* |
* |
312 |
* @is_ipv6: True if @address is an IPv6 address. |
* @is_ipv6: True if @address is an IPv6 address. |
313 |
* @address: An IPv4 or IPv6 address. |
* @address: An IPv4 or IPv6 address. |
315 |
* |
* |
316 |
* Returns true if @address matches addresses in @group group, false otherwise. |
* Returns true if @address matches addresses in @group group, false otherwise. |
317 |
*/ |
*/ |
318 |
static bool ccs_address_matches_to_group(const bool is_ipv6, const u32 *address, |
static bool ccs_address_matches_group(const bool is_ipv6, const u32 *address, |
319 |
const struct ccs_address_group_entry * |
const struct ccs_address_group_entry * |
320 |
group) |
group) |
321 |
{ |
{ |
322 |
struct ccs_address_group_member *member; |
struct ccs_address_group_member *member; |
323 |
const u32 ip = ntohl(*address); |
const u32 ip = ntohl(*address); |
625 |
acl->max_port < port || !ccs_check_condition(&r, ptr)) |
acl->max_port < port || !ccs_check_condition(&r, ptr)) |
626 |
continue; |
continue; |
627 |
if (acl->record_type == IP_RECORD_TYPE_ADDRESS_GROUP) { |
if (acl->record_type == IP_RECORD_TYPE_ADDRESS_GROUP) { |
628 |
if (!ccs_address_matches_to_group(is_ipv6, address, |
if (!ccs_address_matches_group(is_ipv6, address, |
629 |
acl->u.group)) |
acl->u.group)) |
630 |
continue; |
continue; |
631 |
} else if (acl->record_type == IP_RECORD_TYPE_IPv4) { |
} else if (acl->record_type == IP_RECORD_TYPE_IPv4) { |
632 |
if (is_ipv6 || |
if (is_ipv6 || |