On 04/03/2020 22:29, Matthias Andree wrote:
> Am 02.03.20 um 23:39 schrieb Simon Kelley:
>> It's almost 18 months since the last release of dnsmasq, which is far
>> too long.
>>
>> I've done my best over the last couple of weeks to tie up loose-ends, so
>> that a 2.81 release can happen. There are ongoing development efforts,
>> but they may have to wait for the 2.82 release, which I intend to be
>> much sooner after 2.81.
>>
>> So, I've just tagged 2.81rc1, get it from git, or at
>>
>> http://www.thekelleys.org.uk/dnsmasq/release-candidates/dnsmasq-2.81rc1.tar.gz
>>
>> and let me know 1) if there are any showstopping bugs. or 2) there are
>> are any loose ends I missed.
>>
>> Once those, if any, are dealt with, we shall have a new release!
> 
> Simon,
> 
> good to see progress towards a new release.
> 
> Unfortunately, dnsmasq 2.81rc1 doesn't compile under FreeBSD OOTB, and I
> don't have much time to investigate run-time behaviour, so I hope the
> info below helps. The patches I use are at
> https://svnweb.freebsd.org/ports/head/dns/dnsmasq-devel/files, but the
> warning issue at the end of this email isn't fixed by them.
> 
> The SOL_TCP is non-portable and it also contradicts POSIX and Linux
> manpages, - unless we use SOL_SOCKET, we're supposed to use
> getprotoent(3) to get the magic number for "TCP level", whereas POSIX
> suggests to use IPPROTO_TCP.
> 
> Best read these error messages with a __fixed-width__ font.
> 
>> gmake[3]: Entering directory
>> '/usr/ports.svn/dns/dnsmasq-devel/work/dnsmasq-2.81rc1/src'
>> cc -O2 -pipe  -Wall -Wno-unused-value -Wno-unused-parameter
>> -Wno-unused-variable -Wno-unused-function -DHAVE_LIBIDN2 -DHAVE_DBUS
>> -DHAVE_LUASCRIPT -DHAVE_DNSSEC -I/usr/local/include -DLIBICONV_PLUG
>> -fstack-protector-strong -fno-strict-aliasing  -O2 -pipe  -Wall
>> -Wno-unused-value -Wno-unused-parameter -Wno-unused-variable
>> -Wno-unused-function -DHAVE_LIBIDN2 -DHAVE_DBUS -DHAVE_LUASCRIPT
>> -DHAVE_DNSSEC -I/usr/local/include -DLIBICONV_PLUG
>> -fstack-protector-strong -fno-strict-aliasing 
>> -DLOCALEDIR='"/usr/local/share/locale"' -DVERSION='"2.81rc1"'
>> -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include  
>> -I/usr/local/include       -I/usr/local/include  -I/usr/local/include
>> -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include 
>> -I/usr/local/include/lua52 -DLIBICONV_PLUG -c network.c    
>> network.c:731:22: error: use of undeclared identifier 'SOL_TCP'
>>       setsockopt(fd, SOL_TCP, TCP_FASTOPEN, &qlen, sizeof(qlen));
>>                      ^
>> 1 error generated.
>> gmake[3]: ***
>> [/usr/ports.svn/dns/dnsmasq-devel/work/dnsmasq-2.81rc1/Makefile:161:
>> network.o] Error 1
> 


Thanks, I applied your patch verbatim.

> The other things appears to be an improper reference, config->addr6
> appears to be the union and not its member. First clang:
> 
>> cc -O2 -pipe  -Wall -Wno-unused-value -Wno-unused-parameter
>> -Wno-unused-variable -Wno-unused-function -DHAVE_LIBIDN2 -DHAVE_DBUS
>> -DHAVE_LUASCRIPT -DHAVE_DNSSEC -I/usr/local/include -DLIBICONV_PLUG
>> -fstack-protector-strong -fno-strict-aliasing  -O2 -pipe  -Wall
>> -Wno-unused-value -Wno-unused-parameter -Wno-unused-variable
>> -Wno-unused-function -DHAVE_LIBIDN2 -DHAVE_DBUS -DHAVE_LUASCRIPT
>> -DHAVE_DNSSEC -I/usr/local/include -DLIBICONV_PLUG
>> -fstack-protector-strong -fno-strict-aliasing 
>> -DLOCALEDIR='"/usr/local/share/locale"' -DVERSION='"2.81rc1"'
>> -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include  
>> -I/usr/local/include       -I/usr/local/include  -I/usr/local/include
>> -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include 
>> -I/usr/local/include/lua52 -DLIBICONV_PLUG -c rfc3315.c    
>> rfc3315.c:1193:44: error: member reference base type 'struct addrlist
>> *' is not a structure or union
>>                 if (have_config(config, CONFIG_ADDR6) &&
>> IN6_ARE_ADDR_EQUAL(&config->addr6, &addr))
>>                                                         
>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> /usr/include/netinet6/in6.h:232:17: note: expanded from macro
>> 'IN6_ARE_ADDR_EQUAL'
>>     (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct
>> in6_addr)) == 0)
>>              ~~~^ ~~~~~~~
>> 1 error generated.
> GCC words the error differently:
> 
>> rfc3315.c: In function 'dhcp6_no_relay':
>> rfc3315.c:1193:44: error: 'config->addr6' is a pointer; did you mean
>> to use '->'?
>>  1193 |   if (have_config(config, CONFIG_ADDR6) &&
>> IN6_ARE_ADDR_EQUAL(&config->addr6, &addr))
>>       |                                            ^~~~~~~~~~~~~~~~~~
> 
> here, you have
> 
> struct dhcp_config *config;
> 
> struct dhcp_config {
> //...
>   struct addrlist *addr6;
> //...
> }
> 
> struct addrlist {
>   union all_addr addr;
> // ...
>   struct addrlist *next;
> }
> 
> union all_addr {
> //...
>    struct in6_addr addr6;
> // ...
> }
> 
> So I guess this should be
> /* ... */ && IN6_ARE_ADDR_EQUAL(&config->addr6->addr.addr6, &addr))   //
> at least, this compiles
> 

This turned out to be a rather larger can-of-worms, and the fix somewhat
bigger. It's unexpected fallout from the multiple IPv6 addresses in
dhcp-host changes.

http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=c125c1dfeee7ad11bf4a64fd8427617a3861d759

> 
> And finally there's a portability warning that I only get with clang,
> but not with GCC:
> 
>> dump.c:136:18: warning: taking address of packed member 'ip6_src' of
>> class or structure 'ip6_hdr' may result in an unaligned pointer value
>> [-Waddress-of-packed-member]
>>         sum += ((u16 *)&ip6.ip6_src)[i];
>>                         ^~~~~~~~~~~
>> 1 warning generated.


Fixed by

http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=1df73fe8313f806984b446f7751241eccc33a4ee

> 
> HTH & cheers,


It certainly did H, cheers,



Simon.
> 
> Matthias
> 
> 
> 


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

Reply via email to