[Dnsmasq-discuss] 2.60rc4 bug

Matthias Andree matthias.andree at gmx.de
Wed Feb 29 23:29:15 GMT 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 29.02.2012 22:56, schrieb Preston Crow:
> Yup.  RC4 is good with the ebuild.  I would be surprised if the same
> issue didn't hit everyone building from source on Linux.  I was just
> working on RC2 when I received this email, so good timing.

I'd vote "HOLD YOUR HORSES" on RC4.  There's a bug in radv.c line 67 (or
rather line 57) in that you declare the wrong type for "len". You need
socklen_t, but use size_t, which aren't synonyms (this is on FreeBSD
9-STABLE amd64 with clang - because it gives clearer error messages than
gcc -, but I checked against POSIX 2008 and Ubuntu 11.04):

- -----------------------------------------------------------------------
clang -O2 -pipe -fno-strict-aliasing
- -DLOCALEDIR='"/tmp/dnsmasq-2.60.r4_1/share/locale"'
- -DVERSION='"2.60rc4"'      -I/usr/local/include    -c radv.c	
radv.c:67:67: warning: incompatible pointer types passing 'size_t *'
      (aka 'unsigned long *') to parameter of type 'socklen_t *'
      (aka 'unsigned int *') [-Wincompatible-pointer-types]
      getsockopt(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &hop_limit, &len) ||
                                                                  ^~~~
/usr/include/sys/socket.h:612:72: note: passing argument to parameter here
int     getsockopt(int, int, int, void * __restrict, socklen_t *
__restrict);
                                                                           ^
- -----------------------------------------------------------------------
cc -O2 -pipe -fno-strict-aliasing
- -DLOCALEDIR='"/tmp/dnsmasq-2.60.r4_1/share/locale"'
- -DVERSION='"2.60rc4"'      -I/usr/local/include    -c radv.c	
radv.c: In function 'ra_init':
radv.c:67: warning: passing argument 5 of 'getsockopt' from incompatible
pointer type
- -----------------------------------------------------------------------
SYNOPSIS
     #include <sys/types.h>
     #include <sys/socket.h>

     int
     getsockopt(int s, int level, int optname, void * restrict optval,
         socklen_t * restrict optlen);
...
- -----------------------------------------------------------------------

Also, when building with clang, there are some more warnings about
unused results in expressions.  I haven't investigated these.  If you
want to discard results, cast to void (possibly inside some macro):

rfc1035.c:322:9: warning: expression result unused [-Wunused-value]
          if (!ADD_RDLEN(header, ansp, plen, len))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rfc1035.c:28:42: note: expanded from:
    (!CHECK_LEN(header, pp, plen, len) ? 0 : (long)((pp) += (len)), 1)
                                         ^
rfc1035.c:361:12: warning: expression result unused [-Wunused-value]
      if (!ADD_RDLEN(header, ansp, plen, rdlen))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rfc1035.c:28:42: note: expanded from:
    (!CHECK_LEN(header, pp, plen, len) ? 0 : (long)((pp) += (len)), 1)
                                         ^
rfc1035.c:494:12: warning: expression result unused [-Wunused-value]
      if (!ADD_RDLEN(header, ansp, plen, rdlen))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rfc1035.c:28:42: note: expanded from:
    (!CHECK_LEN(header, pp, plen, len) ? 0 : (long)((pp) += (len)), 1)
                                         ^
rfc1035.c:716:12: warning: expression result unused [-Wunused-value]
      if (!ADD_RDLEN(header, p, qlen, rdlen))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rfc1035.c:28:42: note: expanded from:
    (!CHECK_LEN(header, pp, plen, len) ? 0 : (long)((pp) += (len)), 1)
                                         ^
rfc1035.c:763:17: warning: expression result unused [-Wunused-value]
      else if (!ADD_RDLEN(header, p, qlen, rdlen))
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rfc1035.c:28:42: note: expanded from:
    (!CHECK_LEN(header, pp, plen, len) ? 0 : (long)((pp) += (len)), 1)
                                         ^
rfc1035.c:1173:12: warning: expression result unused [-Wunused-value]
      if (!ADD_RDLEN(header, p, qlen, rdlen))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rfc1035.c:28:42: note: expanded from:
    (!CHECK_LEN(header, pp, plen, len) ? 0 : (long)((pp) += (len)), 1)
                                         ^

It is probably safe to leave the unused-value warnings unfixed for 2.60,
but the pointer size bug definitely needs fixing before the 2.60 release.

Best regards
Matthias
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk9OtMQACgkQvmGDOQUufZX/LQCZAVbeQcfJTbczo7rhwguZIXFW
C5UAnjvT6B1ceRLh0FQnyf6ffA5XSe27
=qSBj
-----END PGP SIGNATURE-----



More information about the Dnsmasq-discuss mailing list