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. 3
      src/sn_utils.c

3
src/sn_utils.c

@ -816,8 +816,10 @@ static int process_udp(n2n_sn_t * sss,
existance (better from the security standpoint) existance (better from the security standpoint)
*/ */
if (!comm) {
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_length == strlen(cmn.community)) // --- only full matches allowed (remove, if also partial matches wanted) && (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) && (allowed_match == 0)) { // --- only full matches allowed (remove, if also partial matches wanted)
@ -825,6 +827,7 @@ static int process_udp(n2n_sn_t * sss,
break; break;
} }
} }
}
if(!comm && (!sss->lock_communities || (match == 1))) { if(!comm && (!sss->lock_communities || (match == 1))) {
comm = calloc(1, sizeof(struct sn_community)); comm = calloc(1, sizeof(struct sn_community));

Loading…
Cancel
Save