Browse Source

guarded ITERation through patterns by if-clause for it only gets performed in case of still unknown community

pull/349/head
Logan007 4 years ago
parent
commit
fed02348aa
  1. 17
      src/sn_utils.c

17
src/sn_utils.c

@ -816,13 +816,16 @@ static int process_udp(n2n_sn_t * sss,
existance (better from the security standpoint)
*/
HASH_ITER(hh, sss->rules, re, tmp_re) {
allowed_match = re_matchp(re->rule, cmn.community, &match_length);
if( (allowed_match != -1)
&& (match_length == strlen(cmn.community)) // --- only full matches allowed (remove, if also partial matches wanted)
&& (allowed_match == 0)) { // --- only full matches allowed (remove, if also partial matches wanted)
match = 1;
break;
if (!comm) {
HASH_ITER(hh, sss->rules, re, tmp_re) {
allowed_match = re_matchp(re->rule, cmn.community, &match_length);
if( (allowed_match != -1)
&& (match_length == strlen(cmn.community)) // --- only full matches allowed (remove, if also partial matches wanted)
&& (allowed_match == 0)) { // --- only full matches allowed (remove, if also partial matches wanted)
match = 1;
break;
}
}
}

Loading…
Cancel
Save