[Dnsmasq-discuss] [PATCH] Add DHCPv6 NTP server option handling

2020-03-06 Thread Vladislav Grishenko
Hi, Simon

There was discussion in the past regarding DHCPv6 NTP server option which needs 
special subclassing per RFC5908.
Patch adds support for unicast, multicast IPv6 address and for FQDN string, 
preserving possibly used (as suggested earlier) hex value.
Unfortunately it's still not fully free from limitations - only address list or 
only fqdn value list is possible, not mixed due current state option parsing & 
flagging.
Would be nice to have it in 2.81.

Hi Kevin,
FYI

Thank you and
Best Regards, Vladislav Grishenko



0001-Add-DHCPv6-ntp-server-56-option-handling.patch
Description: Binary data
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] space two point eighty one

2020-03-06 Thread Geert Stappers
On Fri, Mar 06, 2020 at 02:53:43PM +, Mark Grant wrote:
> On Thu, 5 Mar 2020 22:34:29 +, Simon Kelley wrote:
> > On 05/03/2020 21:05, Geert Stappers wrote:
> > > On Thu, Mar 05, 2020 at 09:46:21PM +0100, Geert Stappers wrote:  
> > >>>   ...
> > >>
> > >> I plea for removal of unneeded ' ' and ' '.
> > >>
> > >> That removal can be done with:
> > >>
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc  
> > > 
> > > Numbers from output of `wc` increased.
> > > 
> > >   
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> > >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc  
> > > 
> > > Output of `wc` is stable.
> > > 
> > > At this point you probably want to do `git diff`
> > > and will see that trailing-space-only-lines are removed.
> > > 
> > >   
> > >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc  
> > > 
> > > Lines that had only spaces or tabs got that white space removed.
> > > 
> > >
> > >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
> > >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc  
> > > 
> > > Output of `wc` is stable.
> > > 
> > > `git diff` is huge, almost 22000 lines.  Yes, a huge clean-up.

| $ git diff | wc
| 21782   77039  600247

That 21782  became the "almost 22000 lines"

> > > 
> > > I love to see that in the 2.81 release of dnsmasq.
> > > 
> > >  git commit -am "Removed useless whitespace" --author "Geert Stappers 
> > > "
> > > 
> > >   
> > 
> > The obvious problem with doing that is that for ever more, when I run
> > "git blame" 22000 lines will have the source "Removed useless whitespace".

Euh `git diff` has "context".
Better numbers in another email.

> > I have a feeling someone once posted a solution to that, but I don't
> > have time to trawl back and find it. Can anyone help?
> > 
> Does
>   git blame -w
> do the trick?
> 
> Mark

stappers@paddy:~/src/dnsmasq
$ git blame -w src/arp.c | head -n 15
2a8710ac (Simon Kelley 2020-01-05 16:40:06 +   1) /* dnsmasq is Copyright 
(c) 2000-2020 Simon Kelley
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   2) 
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   3)This program is free 
software; you can redistribute it and/or modify
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   4)it under the terms of 
the GNU General Public License as published by
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   5)the Free Software 
Foundation; version 2 dated June, 1991, or
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   6)(at your option) 
version 3 dated 29 June, 2007.
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   7) 
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   8)This program is 
distributed in the hope that it will be useful,
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +   9)but WITHOUT ANY 
WARRANTY; without even the implied warranty of
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  10)MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  11)GNU General Public 
License for more details.
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  12) 
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  13)You should have 
received a copy of the GNU General Public License
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  14)along with this 
program.  If not, see .
11867dc2 (Simon Kelley 2015-12-23 16:15:58 +  15) */
stappers@paddy:~/src/dnsmasq
$ git blame src/arp.c | head -n 15
2a8710ac (Simon Kelley   2020-01-05 16:40:06 +   1) /* dnsmasq is Copyright 
(c) 2000-2020 Simon Kelley
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   2) 
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   3)This program is free 
software; you can redistribute it and/or modify
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   4)it under the terms 
of the GNU General Public License as published by
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   5)the Free Software 
Foundation; version 2 dated June, 1991, or
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   6)(at your option) 
version 3 dated 29 June, 2007.
e0984534 (Geert Stappers 2020-03-06 23:12:53 +0100   7) 
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   8)This program is 
distributed in the hope that it will be useful,
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +   9)but WITHOUT ANY 
WARRANTY; without even the implied warranty of
11867dc2 (Simon Kelley   2015-12-23 16:15:58 +  10)MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the
11867dc2 

Re: [Dnsmasq-discuss] Performance statistics of upstream DNS servers?

2020-03-06 Thread Simon Kelley



On 06/03/2020 20:46, fiber...@mail.com wrote:
> Hi all!
> 
> Are performance statistics collected on DNS request responses from upstream 
> DNS servers?
> 
> For example if I configure 8.8.8.8 and 1.1.1.1 as DNS servers, can I look up 
> the statistics on how well (min/max/avg msecs) each of them are performing on 
> DNS requests?
> 

The cache sump (send SIGUSR1 to dnsmasq) tells you how many queries were
handled by each server, and how mant no-replies there were, but not timing.

Simon.


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] [PATCH] DHCPv6 - List or Range reservation for single host

2020-03-06 Thread Petr Menšík
Hi Simon,

I have been adapting this feature to earlier releases and discovered one
error with prefixed address assignment. When it is calculating number of
addresses from prefixlen, it rotates only 32bit int instead of 64b uint.
Only result is assigned to 64b variable.

Two examples:

dhcp-host=[2000::1230:0:0/92],correct-prefix
dhcp-host=[2000::1234:5678:0/92],incorrect-prefix

If prefix length is lower than 96, the result is zero. It means
incorrect-prefix is not refused as it should. Fix is simple, attaching
patch with it. Just rotate 64b int. It is just minor issue, but would be
nice to fix it before 2.81 is released.

Thanks!

Cheers,
Petr

On 2/13/20 12:31 AM, Simon Kelley wrote:
> On 10/02/2020 22:18, Harald Jensås wrote:
>> On Mon, 2020-02-10 at 21:37 +, Simon Kelley wrote:
>>> On 10/02/2020 17:56, Harald Jensås wrote:
 On Fri, 2020-02-07 at 21:27 +, Simon Kelley wrote:
> Two commits in the repo, one adds arbitrary list of IPv6
> addresses to
> dhcp-host, second adds tags.
>
> Please  give them a whirl
>

 Thank you for working on this Simon. I have tested the following
 configuration variations and there seem to be one small issue, but
 overall it is working nicely.

 The one test that fails is:

 * Use a prefix with wildcard address:
   dhcp-host=52:54:00:3f:5c:c0,[::aa08/126],host1
   Test: FAIL

   In this configuration the first request succeeds, following
   requests get 'no address available'. Looks like it does'nt try
   the ::aa09 address when aa08 is already leased.

>>>
>>> Excellent. Thanks for the comprehensive testing. I just pushed the
>>> fix
>>> for this bug.
>>>
>>
>> Fantastic! I can confirm the last commit fixed the bug.
>>
>> I also re-ran some of the other smoke tests and everything works as
>> expected.
>>
>> Thanks!
>>
> 
> 
> That's great. I'm trying to catch up on all the loose ends and release
> 2.81 ASAP.
> 
> 
> Cheers,
> 
> Simon.
> 
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 

-- 
Petr Menšík
Software Engineer
Red Hat, http://www.redhat.com/
email: pemen...@redhat.com
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB
>From 6307208c806f9b968eca178931b3d77c4ed83c54 Mon Sep 17 00:00:00 2001
From: Petr Mensik 
Date: Fri, 6 Mar 2020 15:37:23 +0100
Subject: [PATCH] Correct range check of dhcp-host prefix

It incorrectly works with 32 bit integer only when counting number of
addresses in range. It works correctly only between prefixlen 96 and
128. Use 64bit shift to work with well with numbers higher than 64.

Fixes commit 79aba0f10ad0157fb4f48afbbcb03f094caff97a error.
---
 src/option.c  | 2 +-
 src/rfc3315.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/option.c b/src/option.c
index 88cd2ab..79122df 100644
--- a/src/option.c
+++ b/src/option.c
@@ -3247,7 +3247,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
 			
 			if (!atoi_check(pref, _addr->prefixlen) ||
 			new_addr->prefixlen > 128 ||
-			(((1<<(128-new_addr->prefixlen))-1) & addrpart) != 0)
+			u64)1<<(128-new_addr->prefixlen))-1) & addrpart) != 0)
 			  {
 			dhcp_config_free(new);
 			ret_err(_("bad IPv6 prefix"));
diff --git a/src/rfc3315.c b/src/rfc3315.c
index a0067e9..f59aedc 100644
--- a/src/rfc3315.c
+++ b/src/rfc3315.c
@@ -1798,7 +1798,7 @@ static int config_valid(struct dhcp_config *config, struct dhcp_context *context
   addresses = 1;
 
   if (addr_list->flags & ADDRLIST_PREFIX)
-	addresses = 1<<(128-addr_list->prefixlen);
+	addresses = (u64)1<<(128-addr_list->prefixlen);
 		
   if ((addr_list->flags & ADDRLIST_WILDCARD))
 	{
-- 
2.21.1

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Performance statistics of upstream DNS servers?

2020-03-06 Thread fiberrun
Hi all!

Are performance statistics collected on DNS request responses from upstream DNS 
servers?

For example if I configure 8.8.8.8 and 1.1.1.1 as DNS servers, can I look up 
the statistics on how well (min/max/avg msecs) each of them are performing on 
DNS requests?

Best regards,

JB

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] space two point eighty one

2020-03-06 Thread Mark Grant


On Thu, 5 Mar 2020 22:34:29 +, Simon Kelley wrote:

> On 05/03/2020 21:05, Geert Stappers wrote:
> > On Thu, Mar 05, 2020 at 09:46:21PM +0100, Geert Stappers wrote:  
> >> Previous-Subject: Re: [Dnsmasq-discuss] Announce: dnsmasq-2.81rc1
> >> In-Reply-To:
> >> <46b01ef6-df07-44ed-86ba-ccbd2efdb...@darbyshire-bryant.me.uk> On
> >> Tue, Mar 03, 2020 at 09:07:15AM +, Kevin 'ldir'
> >> Darbyshire-Bryant wrote:  
> >>> On 3 Mar 2020, at 06:31, Geert Stappers 
> >>> wrote:  
>  On Mon, Mar 02, 2020 at 10:39:26PM +, Simon Kelley wrote:  
> >
> > ... and let me know ... if there are any loose ends I missed.
> >  
> 
>  In
>  http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2020q1/013757.html
>  is int count, new;
>  -  struct dhcp_config *config, *candidate;
>  +  struct dhcp_config *config, *candidate;
>    struct hwaddr_config *conf_addr;  
> >>>
> >>> Not sure I understand the relevance Geert but as is common with
> >>> these sort of non obvious replacements, there’s a ‘rogue’ white
> >>> space at the end of the replaced line which is removed by its
> >>> replacement.  
> >>  
> >> Yes, that is the problem:  rogue white space is considered
> >> irrelevant
> >>
> >> I plea for removal of unneeded ' ' and '   '.
> >>
> >> That removal can be done with:
> >>
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc  
> > 
> > Numbers from output of `wc` increased.
> > 
> >   
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc
> >> sed --in-place -e '${/^ *$/d;}' src/*.c ; git diff | wc  
> > 
> > Output of `wc` is stable.
> > 
> > At this point you probably want to do `git diff`
> > and will see that trailing-space-only-lines are removed.
> > 
> >   
> >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc  
> > 
> > Lines that had only spaces or tabs got that white space removed.
> > 
> >
> >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc
> >> sed --in-place -e 's/^[ \t]*$//' src/*.c ; git diff | wc  
> > 
> > Output of `wc` is stable.
> > 
> > `git diff` is huge, almost 22000 lines.  Yes, a huge clean-up.
> > 
> > 
> > I love to see that in the 2.81 release of dnsmasq.
> > 
> >  git commit -am "Removed useless whitespace" --author "Geert
> > Stappers "
> > 
> >   
> 
> The obvious problem with doing that is that for ever more, when I run
> "git blame" 22000 lines will have the source "Removed useless
> whitespace".
> 
> I have a feeling someone once posted a solution to that, but I don't
> have time to trawl back and find it. Can anyone help?
> 
Does
git blame -w

do the trick?
Mark
> 
> Simon.
> 
> 


pgpYI64PxC56f.pgp
Description: OpenPGP digital signature
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] dnsmasq-2.81rc2 findings on macos

2020-03-06 Thread Kevin 'ldir' Darbyshire-Bryant
2 patches attached.  Did send via git but they don’t appear to have arrived… 
yet.



> On 6 Mar 2020, at 09:52, Kevin 'ldir' Darbyshire-Bryant 
>  wrote:
> 
> Signed PGP part
> Hi Simon,
> 
> Some findings for you when building on 2.81rc2 on MacOS Catalina.  Don’t know 
> how much of this is new as I only tried it as an experiment :-)
> 
> This definitely looks wrong :-)
> 
> rfc3315.c:1711:28: warning: use of logical '&&' with constant operand 
> [-Wconstant-logical-operand]
>if (!(addr_list->flags && ADDRLIST_DECLINED)
> 
> 
> $ make
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c cache.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c rfc1035.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c util.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c option.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c forward.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c network.c
> network.c:786:23: warning: unused parameter 'fd' [-Wunused-parameter]
> int tcp_interface(int fd, int af)
>  ^
> network.c:786:31: warning: unused parameter 'af' [-Wunused-parameter]
> int tcp_interface(int fd, int af)
>  ^
> network.c:1156:54: warning: unused parameter 'intname' [-Wunused-parameter]
> int local_bind(int fd, union mysockaddr *addr, char *intname, unsigned int 
> ifindex, int is_tcp)
> ^
> 3 warnings generated.
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c dnsmasq.c
> dnsmasq.c:1862:9: warning: unused variable 'a' [-Wunused-variable]
>char a;
> ^
> dnsmasq.c:1913:10: warning: unused variable 'a' [-Wunused-variable]
>  char a = 0;
>   ^
> 2 warnings generated.
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c dhcp.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c lease.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c rfc2131.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c netlink.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c dbus.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c bpf.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c helper.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c tftp.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c log.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c conntrack.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c dhcp6.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c rfc3315.c
> rfc3315.c:1711:28: warning: use of logical '&&' with constant operand 
> [-Wconstant-logical-operand]
>if (!(addr_list->flags && ADDRLIST_DECLINED) ||
>   ^  ~
> rfc3315.c:1711:28: note: use '&' for a bitwise operation
>if (!(addr_list->flags && ADDRLIST_DECLINED) ||
>   ^~
>   &
> rfc3315.c:1711:28: note: remove constant to silence this warning
>if (!(addr_list->flags && ADDRLIST_DECLINED) ||
>  ~^~~~
> 1 warning generated.
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c dhcp-common.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c outpacket.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c radv.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c slaac.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c auth.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c ipset.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c domain.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c dnssec.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c blockdata.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c tables.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c loop.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c inotify.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c poll.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c rrfilter.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c edns0.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c arp.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c crypto.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c dump.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c ubus.c
> cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c metrics.c
> cc  -o dnsmasq cache.o rfc1035.o util.o option.o forward.o network.o 
> dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o helper.o tftp.o 
> log.o conntrack.o dhcp6.o rfc3315.o dhcp-common.o outpacket.o radv.o slaac.o 
> auth.o ipset.o domain.o dnssec.o blockdata.o tables.o loop.o inotify.o poll.o 
> rrfilter.o edns0.o arp.o crypto.o dump.o ubus.o metrics.o
> 
> Cheers,
> 
> Kevin D-B
> 
> gpg: 012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A
> 
> 
> 


Cheers,

Kevin D-B

gpg: 012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A



[Dnsmasq-discuss] [PATCH 2/2] rfc3315: fix incorrect logical '&&' warning

2020-03-06 Thread Kevin Darbyshire-Bryant
rfc3315.c:1711:28: warning: use of logical '&&' with constant operand 
[-Wconstant-logical-operand]
if (!(addr_list->flags && ADDRLIST_DECLINED) ||
   ^  ~

It's a flag bit so should be bitwise '&' operator

Signed-off-by: Kevin Darbyshire-Bryant 
---
 src/rfc3315.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rfc3315.c b/src/rfc3315.c
index eec8776..43ed4f8 100644
--- a/src/rfc3315.c
+++ b/src/rfc3315.c
@@ -1708,7 +1708,7 @@ static int config_valid(struct dhcp_config *config, 
struct dhcp_context *context
 return 0;
 
   for (addr_list = config->addr6; addr_list; addr_list = addr_list->next)
-if (!(addr_list->flags && ADDRLIST_DECLINED) ||
+if (!(addr_list->flags & ADDRLIST_DECLINED) ||
difftime(now, addr_list->decline_time) >= (float)DECLINE_BACKOFF)
   {
addrpart = addr6part(_list->addr.addr6);
-- 
2.21.1 (Apple Git-122.3)


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] [PATCH 1/2] suppress non linux network unused var warnings

2020-03-06 Thread Kevin Darbyshire-Bryant
Signed-off-by: Kevin Darbyshire-Bryant 
---
 src/dnsmasq.c | 4 +++-
 src/network.c | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/dnsmasq.c b/src/dnsmasq.c
index 10f19ea..286a1cd 100644
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -1860,7 +1860,8 @@ static void check_dns_listeners(time_t now)
if (daemon->tcp_pids[i] == 0 && daemon->tcp_pipes[i] == -1)
  {
char a;
-   
+   (void)a; /* suppress potential unused warning */
+
daemon->tcp_pids[i] = p;
daemon->tcp_pipes[i] = pipefd[0];
 #ifdef HAVE_LINUX_NETWORK
@@ -1911,6 +1912,7 @@ static void check_dns_listeners(time_t now)
  if (!option_bool(OPT_DEBUG))
{
  char a = 0;
+ (void)a; /* suppress potential unused warning */
  alarm(CHILD_LIFETIME);
  close(pipefd[0]); /* close read end in child. */
  daemon->pipe_to_parent = pipefd[1];
diff --git a/src/network.c b/src/network.c
index cb956ca..4bada37 100644
--- a/src/network.c
+++ b/src/network.c
@@ -785,6 +785,8 @@ int set_ipv6pktinfo(int fd)
 /* Find the interface on which a TCP connection arrived, if possible, or zero 
otherwise. */
 int tcp_interface(int fd, int af)
 { 
+  (void)fd; /* suppress potential unused warning */
+  (void)af; /* suppress potential unused warning */
   int if_index = 0;
 
 #ifdef HAVE_LINUX_NETWORK
@@ -1187,6 +1189,7 @@ int local_bind(int fd, union mysockaddr *addr, char 
*intname, unsigned int ifind
 #endif
 }
 
+  (void)intname; /* suppress potential unused warning */
 #if defined(SO_BINDTODEVICE)
   if (intname[0] != 0 &&
   setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, intname, IF_NAMESIZE) == -1)
-- 
2.21.1 (Apple Git-122.3)


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] dnsmasq-2.81rc2 findings on macos

2020-03-06 Thread Kevin 'ldir' Darbyshire-Bryant
Hi Simon,

Some findings for you when building on 2.81rc2 on MacOS Catalina.  Don’t know 
how much of this is new as I only tried it as an experiment :-)

This definitely looks wrong :-)

rfc3315.c:1711:28: warning: use of logical '&&' with constant operand 
[-Wconstant-logical-operand]
if (!(addr_list->flags && ADDRLIST_DECLINED)


$ make
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c cache.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c rfc1035.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c util.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c option.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c forward.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c network.c
network.c:786:23: warning: unused parameter 'fd' [-Wunused-parameter]
int tcp_interface(int fd, int af)
  ^
network.c:786:31: warning: unused parameter 'af' [-Wunused-parameter]
int tcp_interface(int fd, int af)
  ^
network.c:1156:54: warning: unused parameter 'intname' [-Wunused-parameter]
int local_bind(int fd, union mysockaddr *addr, char *intname, unsigned int 
ifindex, int is_tcp)
 ^
3 warnings generated.
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c dnsmasq.c
dnsmasq.c:1862:9: warning: unused variable 'a' [-Wunused-variable]
char a;
 ^
dnsmasq.c:1913:10: warning: unused variable 'a' [-Wunused-variable]
  char a = 0;
   ^
2 warnings generated.
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c dhcp.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c lease.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c rfc2131.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c netlink.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c dbus.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c bpf.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c helper.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c tftp.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c log.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c conntrack.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c dhcp6.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c rfc3315.c
rfc3315.c:1711:28: warning: use of logical '&&' with constant operand 
[-Wconstant-logical-operand]
if (!(addr_list->flags && ADDRLIST_DECLINED) ||
   ^  ~
rfc3315.c:1711:28: note: use '&' for a bitwise operation
if (!(addr_list->flags && ADDRLIST_DECLINED) ||
   ^~
   &
rfc3315.c:1711:28: note: remove constant to silence this warning
if (!(addr_list->flags && ADDRLIST_DECLINED) ||
  ~^~~~
1 warning generated.
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c dhcp-common.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c outpacket.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c radv.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c slaac.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c auth.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c ipset.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c domain.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c dnssec.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c blockdata.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c tables.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c loop.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c inotify.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c poll.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c rrfilter.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c edns0.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c arp.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c crypto.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c dump.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c ubus.c
cc -Wall -W -O2   -DVERSION='"2.81rc2"'   -c metrics.c
cc  -o dnsmasq cache.o rfc1035.o util.o option.o forward.o network.o dnsmasq.o 
dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o helper.o tftp.o log.o 
conntrack.o dhcp6.o rfc3315.o dhcp-common.o outpacket.o radv.o slaac.o auth.o 
ipset.o domain.o dnssec.o blockdata.o tables.o loop.o inotify.o poll.o 
rrfilter.o edns0.o arp.o crypto.o dump.o ubus.o metrics.o

Cheers,

Kevin D-B

gpg: 012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A



signature.asc
Description: Message signed with OpenPGP
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss