在ip地址扫描中增加已加载ipv4/ipv6规则数的判定,避免rulescan输出报警信息。

This commit is contained in:
zhengchao
2016-03-11 14:11:31 +08:00
parent 27100b1727
commit 4006771fca
3 changed files with 34 additions and 2 deletions

View File

@@ -933,6 +933,14 @@ int Maat_scan_proto_addr(Maat_feather_t feather,int table_id
{ {
return 0; return 0;
} }
if(p_table->ipv4_rule_cnt==0&&addr->addrtype==ADDR_TYPE_IPV4)
{
return 0;
}
if(p_table->ipv6_rule_cnt==0&&addr->addrtype==ADDR_TYPE_IPV6)
{
return 0;
}
my_scanner=_feather->scanner; my_scanner=_feather->scanner;
if(my_scanner==NULL) if(my_scanner==NULL)
{ {

View File

@@ -1870,6 +1870,14 @@ void update_ip_rule(struct _Maat_table_info_t* table,const char* table_line,stru
if(ret>0) if(ret>0)
{ {
table->cfg_num--; table->cfg_num--;
if(ip_rule->addr_type==4)
{
table->ipv4_rule_cnt--;
}
else
{
table->ipv6_rule_cnt--;
}
} }
} }
else else
@@ -1885,6 +1893,14 @@ void update_ip_rule(struct _Maat_table_info_t* table,const char* table_line,stru
else else
{ {
table->cfg_num++; table->cfg_num++;
if(ip_rule->addr_type==4)
{
table->ipv4_rule_cnt++;
}
else
{
table->ipv6_rule_cnt++;
}
} }
} }
error_out: error_out:

View File

@@ -228,8 +228,16 @@ struct _Maat_table_info_t
int do_charset_merge; int do_charset_merge;
int cfg_num; int cfg_num;
int cross_cache_size; int cross_cache_size;
union
{
int expr_rule_cnt; //expr_type=0,1,3 int expr_rule_cnt; //expr_type=0,1,3
int ipv4_rule_cnt;
};
union
{
int regex_rule_cnt; //expr_type=2 int regex_rule_cnt; //expr_type=2
int ipv6_rule_cnt;
};
struct _plugin_table_info *cb_info; struct _plugin_table_info *cb_info;
//for stat>>>>>>>> //for stat>>>>>>>>
int stat_line_id; int stat_line_id;