diff --git a/docs/changes.txt b/docs/changes.txt index f15af51..eee2bbd 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -166,3 +166,5 @@ v0.8.1 0.8.3 * nfqws2, zapret-lib: gzip compression and decompression +* nfqws2: ignore trailing spaces and tabs in hostlists and ipsets. "host.com " or "1.2.3.4 " are ok now + diff --git a/nfq2/hostlist.c b/nfq2/hostlist.c index e514e09..d91a30b 100644 --- a/nfq2/hostlist.c +++ b/nfq2/hostlist.c @@ -8,13 +8,8 @@ static bool addpool(hostlist_pool **hostlist, char **s, const char *end, int *ct { char *p=*s; - // comment line - if ( *p == '#' || *p == ';' || *p == '/' || *p == '\r' || *p == '\n') - { - // advance until eol - for (; p=sizeof(cidr)) l=sizeof(cidr)-1; memcpy(cidr,*s,l); cidr[l]=0; - rtrim(cidr); if (parse_cidr4(cidr,&c4)) { @@ -46,6 +44,8 @@ static bool addpool(ipset *ips, char **s, const char *end, int *ct) DLOG_ERR("bad ip or subnet : %s\n",cidr); } + // skip remaining non-eol chars + for (; p