From 7311efa35adf9f1ecfdec29372393f74efaa8657 Mon Sep 17 00:00:00 2001 From: Logan007 Date: Tue, 4 Aug 2020 16:09:09 +0545 Subject: [PATCH] planned regular expression preparation --- src/sn.c | 3 ++- src/sn_utils.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sn.c b/src/sn.c index 76527e0..e880235 100644 --- a/src/sn.c +++ b/src/sn.c @@ -49,7 +49,8 @@ static int load_allowed_sn_community(n2n_sn_t *sss, char *path) { if((len < 2) || line[0] == '#') continue; - +// !!! if (isregexp) then add to regExp list [check this using a "meta"-regExp] +// !!! otherwise (fixed name) do the following len--; while(len > 0) { if((line[len] == '\n') || (line[len] == '\r')) { diff --git a/src/sn_utils.c b/src/sn_utils.c index a74e326..6c9acec 100644 --- a/src/sn_utils.c +++ b/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 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)); if(comm) {