mirror of
https://github.com/ntop/n2n.git
synced 2024-09-20 00:51:10 +02:00
instantiated reg exp pattern
This commit is contained in:
parent
1b3e485da6
commit
e481942bf0
|
@ -248,8 +248,9 @@ re_t re_compile(const char* pattern)
|
||||||
}
|
}
|
||||||
/* 'UNUSED' is a sentinel used to indicate end-of-pattern */
|
/* 'UNUSED' is a sentinel used to indicate end-of-pattern */
|
||||||
re_compiled[j].type = UNUSED;
|
re_compiled[j].type = UNUSED;
|
||||||
|
re_t re_p = (re_t)calloc(1, sizeof(re_compiled));
|
||||||
return (re_t) re_compiled;
|
memcpy (re_p, re_compiled, sizeof(re_compiled));
|
||||||
|
return (re_t) re_p;
|
||||||
}
|
}
|
||||||
|
|
||||||
void re_print(regex_t* pattern)
|
void re_print(regex_t* pattern)
|
||||||
|
|
|
@ -817,7 +817,7 @@ static int process_udp(n2n_sn_t * sss,
|
||||||
|
|
||||||
HASH_ITER(hh, sss->rules, re, tmp_re) {
|
HASH_ITER(hh, sss->rules, re, tmp_re) {
|
||||||
allowed_match = re_matchp(re->rule, cmn.community, &match_length);
|
allowed_match = re_matchp(re->rule, cmn.community, &match_length);
|
||||||
if(allowed_match != -1)
|
if(allowed_match != -1) // ... && match_len == strlen(cmn.community) --- if only full matches allowed
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user