[Dnsmasq-discuss] Domain name wildcard match in the --server option
Geert Stappers
stappers at stappers.nl
Thu Nov 28 22:00:04 GMT 2019
Warning: this email contains a compliment
If you can't handle compliments, stop reading now.
On Wed, Nov 27, 2019 at 06:41:10PM +0100, Geert Stappers wrote:
> On Wed, Nov 27, 2019 at 10:06:33PM +0800, MingJian Hong wrote:
> > It is my first time to submit a patch by 'git send-email'.
> > If it doesn't work, please let me know. Thanks.
>
> Patch did apply. ( not mangled in e-mail )
>
> Better feedback from my later.
} Better feedback from me later.
Now less in a hurry.
What `git send-email` does, is sending email.
The emails are created from previous created patches.
In those patches are commit messages.
> Regards
> Geert Stappers
>
> |stappers at alpaca:~/src/dnsmasq
> |$ git show | head -n 25
show the top twenty-five lines of the latest commit aka patch.
> |commit ded56ce787ac814cd7953d2b2efb9277f4fa1eb6
> |Author: MingJian Hong <hongmingjian at gmail.com>
> |Date: Wed Nov 27 22:06:33 2019 +0800
> |
> | Domain name wildcard match in the --server option
> |
> | It is my first time to submit a patch by 'git send-email'.
> | If it doesn't work, please let me know. Thanks.
> |
> | Regards,
> | hmj
Good text for an email, less good text for a commit message
> |diff --git a/src/forward.c b/src/forward.c
> |index f488b90..8bb3bcf 100644
> |--- a/src/forward.c
> |+++ b/src/forward.c
> |@@ -150,10 +150,19 @@ static unsigned int search_servers(time_t now, union all_addr **addrpp, unsigned
> | }
> | else if (serv->flags & SERV_HAS_DOMAIN)
> | {
> |+ int isequal;
> | unsigned int domainlen = strlen(serv->domain);
> |- char *matchstart = qdomain + namelen - domainlen;
> |+ char *matchstart = strcasestr(qdomain, serv->domain);
> |+ if ((matchstart != NULL) && (*(matchstart+domainlen) == 0 || *(matchstart+domainlen) == '.'))
Great work from MingJian Hong. He came with a question like
How to express /domain.tld.*/
after finding out that
/domain.tld$/
was implemented. Then responsed with a patch that does
/domain.tld.*/
Regards
Geert Stappers
P.S.
Some regular expression characters
/ search string delimiter
. any character
* zero or more character as the previous character
$ end
--
Leven en laten leven
More information about the Dnsmasq-discuss
mailing list