Re: [Dnsmasq-discuss] space two point eighty one
On Sun, Mar 08, 2020 at 05:40:13PM +, Simon Kelley wrote: > On 05/03/2020 21:05, Geert Stappers wrote: > > > > ... "Removed useless whitespace" ... > > > > > > I just spent a couple of hours playing with the options to GNU ident, to > see if I could get it to clean up not just whitespace but also any > identing other more subtle problems, on the grounds that if we're going > to make a huge formatting commit, we should do it just once. > > My conclusion is that there is some stuff in there that needs to be > fixed, but I can't make ident work in a way where I'm happy to run it > automatically. I therefore plan to do this. > > 1) Run ident once over the code with the best options I have, then fix > up the small amount of stuff it does which I don't like (mainly > line-breaks). That should also remove trailing spaces and tabs and > trailing blank lines from files. I'll use Geerts scripts to make sure. > > 2) Commit that. > > 3) Add git hooks to expand or similar to keep the whitespace stuff clean > going forward. > > This is not something I'm going to do for 2.81, sorry Geert. It's too > big a change for this late in the cycle. Acknowlege on "no big change now". Removing tailing white lines ( <1583615260-26446-1-git-send-email-stapp...@alpaca.gpm.stappers.nl> http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2020q1/013866.html ) will help us on the long run. That is because `git diff --ignore-space-change` does report removed lines. Removing the tailing white lines first, means those changes(removals) wouldn't show up when we make further changes. Regards Geert Stappers -- Silence is hard to parse ___ 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
On 05/03/2020 21:05, Geert Stappers wrote: > `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 > " > > I just spent a couple of hours playing with the options to GNU ident, to see if I could get it to clean up not just whitespace but also any identing other more subtle problems, on the grounds that if we're going to make a huge formatting commit, we should do it just once. My conclusion is that there is some stuff in there that needs to be fixed, but I can't make ident work in a way where I'm happy to run it automatically. I therefore plan to do this. 1) Run ident once over the code with the best options I have, then fix up the small amount of stuff it does which I don't like (mainly line-breaks). That should also remove trailing spaces and tabs and trailing blank lines from files. I'll use Geerts scripts to make sure. 2) Commit that. 3) Add git hooks to expand or similar to keep the whitespace stuff clean going forward. This is not something I'm going to do for 2.81, sorry Geert. It's too big a change for this late in the cycle. Cheers, Simon. signature.asc 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] Patches DHCPv6
In-Reply-To: <20200207220832.dsvb5gtd5g2by4ob@pali> On Fri, Feb 07, 2020 at 11:08:32PM +0100, Pali Rohár wrote: > Hello Simon! > > Could you please review / comment this patch? > > I would like to know what is needed to be fixed or changed, > so patch could be finally merged. Other DHCPv6 patches got merged, if I recall correct. Do they have the functionality that is needed? > On Monday 17 December 2018 18:41:09 Pali Rohár wrote: Do merged DHCPv6 patches have the functionality that were the reason to write original Pali Rohár patches? One reason for asking is the upcoming 2.81 release. Regards Geert Stappers -- Silence is hard to parse ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Regarding: space two point eighty one, take 2
On 3/8/2020 5:17 PM, Geert Stappers wrote: > > Hello John, > > > On Sun, Mar 08, 2020 at 01:35:11PM +0100, john doe wrote: >> On 3/8/2020 12:33 PM, Geert Stappers wrote: >>> On Sat, Mar 07, 2020 at 10:01:30PM +0100, Geert Stappers wrote: In-Reply-To: <1255b7ff-351f-46d7-f811-ac3373102...@thekelleys.org.uk> Now spliting previous change request into two parts: * Removing trailing white_space_only_lines >>> >>> Done, see >>> http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2020q1/013866.html >>> >>> Removed lines don't show up in `git blame`. >>> >>> * Emptying the empty lines >>> >>> Execute: >>> >>> sed --in-place -e 's/^[ \t]*$//' src/*.c src/*.h >>> >>> > ... >>> >>> >>> To prevent that 8% of the lines in future `git blame` >>> will distract us by reminding us on this clean-up. >>> >>> Execute: >>> >>> git commit -am "Removed useless white space" --author="Simon Kelley >>> " >>> >>> >>> >> >> Please use gitsend-email as you are known to be able to use it with the >> '--reroll-count=..' for a new reroll. > > Thanks for telling. I'll use it > in stead of the 'take 2' in the current subject. > Your git send-email command should also include '--in-reply-to' in addition to the '--reroll-count', see also (1) before using those options. When committing, don't forget to "sign-off" ('-s'). > >> So Simon knows which set of patches to consider. > > Looking forward on your help > with > http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2020q1/013864.html > See (2). 1) https://git-scm.com/docs/git-send-email 2) https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases -- John Doe ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] [PATCH] Add DHCPv6 NTP server option handling
On 07/03/2020 00:02, Vladislav Grishenko wrote: > 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. > It's in for 2.81rc3 Cheers, Simon. > Hi Kevin, > FYI > > Thank you and > Best Regards, Vladislav Grishenko > > > ___ > Dnsmasq-discuss mailing list > Dnsmasq-discuss@lists.thekelleys.org.uk > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss > ___ 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
On 06/03/2020 22:10, Petr Menšík wrote: > 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! > > Patch applied, thanks. I'm well aware that there's some important work of yours to fix the problem of interfaces changing index which is not in 2.81. That's not forgotten, but I need you assistance with it, and planned to defer to 2.82 (which will be much quicker than 2.81). If we can get it done now, and you really want it in 2.81 then I'm not ruling that out. Cheers, Simon. ___ 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
On 06/03/2020 09:52, Kevin 'ldir' Darbyshire-Bryant wrote: > 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 > > > ___ > Dnsmasq-discuss mailing list > Dnsmasq-discuss@lists.thekelleys.org.uk > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss > Yes, the
Re: [Dnsmasq-discuss] space two point eighty one, take 2
On 3/8/2020 12:33 PM, Geert Stappers wrote: > On Sat, Mar 07, 2020 at 10:01:30PM +0100, Geert Stappers wrote: >> In-Reply-To: <1255b7ff-351f-46d7-f811-ac3373102...@thekelleys.org.uk> >> On Thu, Mar 05, 2020 at 10:34:29PM +, 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: > ... remove trailing white_space_only_lines ... > > ... empty lines: sed --in-place -e 's/^[ \t]*$//' src/*.c ... I love to see that in the 2.81 release of dnsmasq. >>> >>> The obvious problem with doing that is that for ever more, when I run >> } "git blame" N lines will have the source "Removed useless whitespace". >> >> That valid point shouldn't be a big issue. >> At least I think it can be mitigated. >> >> Now spliting previous change request into two parts: >> * Removing trailing white_space_only_lines > > Done, see > http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2020q1/013866.html > > Removed lines don't show up in `git blame`. > > >> * Emptying the empty lines > > Execute: > > sed --in-place -e 's/^[ \t]*$//' src/*.c src/*.h > > > > > $ git diff | wc > 21923 78016 607091 > $ git diff | grep ^+ | grep -c -v ^+++ > 3053 > $ wc -l src/*.c src/*.h | tail -n 1 > 39474 totaal > $ echo "3053 / 39474 * 100" | bc -l > 7.73420479302832244000 > > > To prevent that 8% of the lines in future `git blame` > will distract us by reminding us on this clean-up. > > Execute: > > git commit -am "Removed useless white space" --author="Simon Kelley > " > > > > $ git blame src/arp.c | sed --silent -e 60,80p > cc921df9 (Simon Kelley 2019-01-02 22:48:59 + 60) if > (!IN6_ARE_ADDR_EQUAL(>addr.addr6, (struct in6_addr *)addrp)) > 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 61) continue; > 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 62) } > 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 63) > 33702ab1 (Simon Kelley 2015-12-28 23:17:15 + 64) if (arp->status > == ARP_EMPTY) > 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 65) { > 33702ab1 (Simon Kelley 2015-12-28 23:17:15 + 66) /* existing > address, was negative. */ > 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 67) arp->status = > ARP_NEW; > 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 68) arp->hwlen = > maclen; > 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 69) memcpy(arp->hwaddr, > mac, maclen); > 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 70) } > 33702ab1 (Simon Kelley 2015-12-28 23:17:15 + 71) else if > (arp->hwlen == maclen && memcmp(arp->hwaddr, mac, maclen) == 0) > 33702ab1 (Simon Kelley 2015-12-28 23:17:15 + 72) /* Existing > entry matches - confirm. */ > 33702ab1 (Simon Kelley 2015-12-28 23:17:15 + 73) arp->status = > ARP_FOUND; > 33702ab1 (Simon Kelley 2015-12-28 23:17:15 + 74) else > 33702ab1 (Simon Kelley 2015-12-28 23:17:15 + 75) continue; > ced2a733 (Simon Kelley 2020-03-08 12:17:53 +0100 76) > 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 77) break; > 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 78) } > 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 79) > 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 80) if (!arp) > > > Please use gitsend-email as you are known to be able to use it with the '--reroll-count=..' for a new reroll. So Simon knows which set of patches to consider. -- John Doe ___ 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, take 2
On Sat, Mar 07, 2020 at 10:01:30PM +0100, Geert Stappers wrote: > In-Reply-To: <1255b7ff-351f-46d7-f811-ac3373102...@thekelleys.org.uk> > On Thu, Mar 05, 2020 at 10:34:29PM +, 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: > > >> ... remove trailing white_space_only_lines ... > > >> > > >> ... empty lines: sed --in-place -e 's/^[ \t]*$//' src/*.c ... > > > > > > I love to see that in the 2.81 release of dnsmasq. > > > > > > > The obvious problem with doing that is that for ever more, when I run > } "git blame" N lines will have the source "Removed useless whitespace". > > That valid point shouldn't be a big issue. > At least I think it can be mitigated. > > Now spliting previous change request into two parts: > * Removing trailing white_space_only_lines Done, see http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2020q1/013866.html Removed lines don't show up in `git blame`. > * Emptying the empty lines Execute: sed --in-place -e 's/^[ \t]*$//' src/*.c src/*.h $ git diff | wc 21923 78016 607091 $ git diff | grep ^+ | grep -c -v ^+++ 3053 $ wc -l src/*.c src/*.h | tail -n 1 39474 totaal $ echo "3053 / 39474 * 100" | bc -l 7.73420479302832244000 To prevent that 8% of the lines in future `git blame` will distract us by reminding us on this clean-up. Execute: git commit -am "Removed useless white space" --author="Simon Kelley " $ git blame src/arp.c | sed --silent -e 60,80p cc921df9 (Simon Kelley 2019-01-02 22:48:59 + 60) if (!IN6_ARE_ADDR_EQUAL(>addr.addr6, (struct in6_addr *)addrp)) 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 61) continue; 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 62) } 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 63) 33702ab1 (Simon Kelley 2015-12-28 23:17:15 + 64) if (arp->status == ARP_EMPTY) 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 65) { 33702ab1 (Simon Kelley 2015-12-28 23:17:15 + 66) /* existing address, was negative. */ 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 67) arp->status = ARP_NEW; 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 68) arp->hwlen = maclen; 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 69) memcpy(arp->hwaddr, mac, maclen); 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 70) } 33702ab1 (Simon Kelley 2015-12-28 23:17:15 + 71) else if (arp->hwlen == maclen && memcmp(arp->hwaddr, mac, maclen) == 0) 33702ab1 (Simon Kelley 2015-12-28 23:17:15 + 72) /* Existing entry matches - confirm. */ 33702ab1 (Simon Kelley 2015-12-28 23:17:15 + 73) arp->status = ARP_FOUND; 33702ab1 (Simon Kelley 2015-12-28 23:17:15 + 74) else 33702ab1 (Simon Kelley 2015-12-28 23:17:15 + 75) continue; ced2a733 (Simon Kelley 2020-03-08 12:17:53 +0100 76) 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 77) break; 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 78) } 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 79) 11867dc2 (Simon Kelley 2015-12-23 16:15:58 + 80) if (!arp) Regards Geert Stappers -- Silence is hard to parse signature.asc Description: PGP signature ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss