Browse Source

planned regular expression preparation

pull/349/head
Logan007 4 years ago
parent
commit
7311efa35a
  1. 3
      src/sn.c
  2. 4
      src/sn_utils.c

3
src/sn.c

@ -49,7 +49,8 @@ static int load_allowed_sn_community(n2n_sn_t *sss, char *path) {
if((len < 2) || line[0] == '#') if((len < 2) || line[0] == '#')
continue; continue;
// !!! if (isregexp) then add to regExp list [check this using a "meta"-regExp]
// !!! otherwise (fixed name) do the following
len--; len--;
while(len > 0) { while(len > 0) {
if((line[len] == '\n') || (line[len] == '\r')) { if((line[len] == '\n') || (line[len] == '\r')) {

4
src/sn_utils.c

@ -812,7 +812,9 @@ static int process_udp(n2n_sn_t * sss,
not report any message back to the edge to hide the supernode not report any message back to the edge to hide the supernode
existance (better from the security standpoint) existance (better from the security standpoint)
*/ */
if(!comm && !sss->lock_communities) { // !!! check if the requested name matches any of the regExps (ITERate)
// !!! put result in variable uint8_t (or so) "allowed_match"
if(!comm && (!sss->lock_communities || allowed_match)) {
comm = calloc(1, sizeof(struct sn_community)); comm = calloc(1, sizeof(struct sn_community));
if(comm) { if(comm) {

Loading…
Cancel
Save