ipport plugin table support CIDR
This commit is contained in:
@@ -445,13 +445,15 @@ static void
|
||||
ipport_item_to_ipport_rule(struct ipport_item *item, struct ipport_rule *rule)
|
||||
{
|
||||
if (IPV4 == item->ip_type) {
|
||||
rule->ip.ip_type= IPV4;
|
||||
rule->ip.ipv4 = item->ipv4.min_ip;
|
||||
rule->ip_type= IPV4;
|
||||
rule->ipv4.start_ip = item->ipv4.min_ip;
|
||||
rule->ipv4.end_ip = item->ipv4.max_ip;
|
||||
rule->min_port = item->min_port;
|
||||
rule->max_port = item->max_port;
|
||||
} else {
|
||||
rule->ip.ip_type = IPV6;
|
||||
memcpy(rule->ip.ipv6, item->ipv6.min_ip, sizeof(item->ipv6.min_ip));
|
||||
rule->ip_type = IPV6;
|
||||
memcpy(rule->ipv6.start_ip, item->ipv6.min_ip, sizeof(item->ipv6.min_ip));
|
||||
memcpy(rule->ipv6.end_ip, item->ipv6.max_ip, sizeof(item->ipv6.max_ip));
|
||||
rule->min_port = item->min_port;
|
||||
rule->max_port = item->max_port;
|
||||
}
|
||||
|
||||
@@ -224,8 +224,6 @@ void plugin_table_all_callback_finish(struct plugin_schema *plugin_schema)
|
||||
|
||||
int plugin_table_get_foreign_names(struct plugin_schema *plugin_schema, char foreign_names[MAX_FOREIGN_CLMN_NUM][MAX_FOREIGN_NAME_LEN + 1])
|
||||
{
|
||||
int n_foreign_keys = 0;
|
||||
|
||||
if (NULL == plugin_schema) {
|
||||
return -1;
|
||||
}
|
||||
@@ -234,7 +232,7 @@ int plugin_table_get_foreign_names(struct plugin_schema *plugin_schema, char for
|
||||
strncpy(foreign_names[i], plugin_schema->foreign_names[i], MAX_FOREIGN_NAME_LEN);
|
||||
}
|
||||
|
||||
return n_foreign_keys;
|
||||
return plugin_schema->n_foreign;
|
||||
}
|
||||
|
||||
int plugin_table_set_ex_container_schema(void *plugin_schema, int table_id,
|
||||
|
||||
Reference in New Issue
Block a user