[Dnsmasq-discuss] Domain name wildcard match in the --server option
Geert Stappers
stappers at stappers.nl
Wed Nov 27 17:41:10 GMT 2019
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.
Regards
Geert Stappers
--
|stappers at alpaca:~/src/dnsmasq
|$ git show | head -n 25
|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
|
|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) == '.'))
|stappers at alpaca:~/src/dnsmasq
|$
More information about the Dnsmasq-discuss
mailing list