mirror of
https://github.com/ntop/n2n.git
synced 2024-09-19 16:41:11 +02:00
polished reg exp handling and fixed bugs
This commit is contained in:
parent
dece8d787e
commit
1d048c59a9
2
src/sn.c
2
src/sn.c
|
@ -100,7 +100,7 @@ static int load_allowed_sn_community(n2n_sn_t *sss, char *path) {
|
|||
|
||||
fclose(fd);
|
||||
|
||||
if (num_regex>0 || num_communities>0 )
|
||||
if ((num_regex + num_communities) == 0)
|
||||
{
|
||||
traceEvent(TRACE_WARNING, "File %s does not contain any valid community names or regular expressions", path);
|
||||
return -1;
|
||||
|
|
|
@ -253,6 +253,9 @@ void sn_term(n2n_sn_t *sss)
|
|||
|
||||
HASH_ITER(hh, sss->rules, re, tmp_re) {
|
||||
HASH_DEL(sss->rules, re);
|
||||
if (NULL!=re->rule) {
|
||||
free(re->rule);
|
||||
}
|
||||
free(re);
|
||||
}
|
||||
}
|
||||
|
@ -833,11 +836,11 @@ static int process_udp(n2n_sn_t * sss,
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(match != 1) {
|
||||
traceEvent(TRACE_INFO, "Discarded registration: unallowed community '%s'",
|
||||
(char*)cmn.community);
|
||||
return -1;
|
||||
if(match != 1) {
|
||||
traceEvent(TRACE_INFO, "Discarded registration: unallowed community '%s'",
|
||||
(char*)cmn.community);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if(!comm && (!sss->lock_communities || (match == 1))) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user