Debian Bug report logs - #566334
dnsmasq: FTBFS on kfreebsd

version graph

Package: dnsmasq; Maintainer for dnsmasq is Simon Kelley <simon@thekelleys.org.uk>; Source for dnsmasq is src:dnsmasq.

Reported by: Axel Beckert <abe@debian.org>

Date: Fri, 22 Jan 2010 23:45:01 UTC

Severity: important

Tags: fixed-upstream, ipv6, patch, sid, squeeze

Fixed in version dnsmasq/2.53-1

Done: Simon Kelley <simon@thekelleys.org.uk>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, abe@deuxchevaux.org, Simon Kelley <simon@thekelleys.org.uk>:
Bug#566334; Package dnsmasq. (Fri, 22 Jan 2010 23:45:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Axel Beckert <abe@deuxchevaux.org>:
New Bug report received and forwarded. Copy sent to abe@deuxchevaux.org, Simon Kelley <simon@thekelleys.org.uk>. (Fri, 22 Jan 2010 23:45:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Axel Beckert <abe@deuxchevaux.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: dnsmasq: FTBFS on kfreebsd
Date: Sat, 23 Jan 2010 00:42:56 +0100 (CET)
Package: dnsmasq
Severity: important
Tags: patch, ipv6
User: debian-bsd@lists.debian.org
Usertags: kfreebsd

Hi,

dnsmasq FTBFS on kfreebsd since the IPv6 support in dnsmasq is Linux-only.

Following a patch which fixes the FTBFS -- hopefully without changing
the build on Linux. I wasn't able to test the functionality of the
patch yet since I only have remote access to kfreebsd machines which
must not run DHCP servers.

diff -ru dnsmasq-2.51/src/forward.c dnsmasq-2.51+kbsd/src/forward.c
--- dnsmasq-2.51/src/forward.c	2009-10-13 18:41:27.000000000 +0200
+++ dnsmasq-2.51+kbsd/src/forward.c	2010-01-23 00:16:14.000000000 +0100
@@ -40,7 +40,11 @@
     char control[CMSG_SPACE(sizeof(struct in_addr))];
 #endif
 #ifdef HAVE_IPV6
+  #if defined(HAVE_LINUX_NETWORK)
     char control6[CMSG_SPACE(sizeof(struct in6_pktinfo))];
+  #elif defined(IP_SENDSRCADDR)
+    char control6[CMSG_SPACE(sizeof(struct in6_addr))];
+  #endif
 #endif
   } control_u;
   
@@ -82,12 +86,20 @@
       else
 #ifdef HAVE_IPV6
 	{
+    #if defined(HAVE_LINUX_NETWORK)
 	  struct in6_pktinfo *pkt = (struct in6_pktinfo *)CMSG_DATA(cmptr);
 	  pkt->ipi6_ifindex = iface; /* Need iface for IPv6 to handle link-local addrs */
 	  pkt->ipi6_addr = source->addr.addr6;
 	  msg.msg_controllen = cmptr->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
 	  cmptr->cmsg_type = IPV6_PKTINFO;
 	  cmptr->cmsg_level = IPV6_LEVEL;
+    #elif defined(IP_SENDSRCADDR)
+	  struct in6_addr *a = (struct in6_addr *)CMSG_DATA(cmptr);
+	  *a = source->addr.addr6;
+	  msg.msg_controllen = cmptr->cmsg_len = CMSG_LEN(sizeof(struct in6_addr));
+	  cmptr->cmsg_level = IPPROTO_IP;
+	  cmptr->cmsg_type = IP_SENDSRCADDR;
+    #endif
 	}
 #else
       iface = 0; /* eliminate warning */
@@ -575,7 +587,12 @@
   union {
     struct cmsghdr align; /* this ensures alignment */
 #ifdef HAVE_IPV6
+  #if defined(HAVE_LINUX_NETWORK)
     char control6[CMSG_SPACE(sizeof(struct in6_pktinfo))];
+  #elif defined(IP_RECVDSTADDR)
+    char control6[CMSG_SPACE(sizeof(struct in6_addr)) +
+		  CMSG_SPACE(sizeof(struct sockaddr_dl))];
+  #endif
 #endif
 #if defined(HAVE_LINUX_NETWORK)
     char control[CMSG_SPACE(sizeof(struct in_pktinfo))];
@@ -663,8 +680,12 @@
 	  for (cmptr = CMSG_FIRSTHDR(&msg); cmptr; cmptr = CMSG_NXTHDR(&msg, cmptr))
 	    if (cmptr->cmsg_level == IPV6_LEVEL && cmptr->cmsg_type == IPV6_PKTINFO)
 	      {
+  #if defined(HAVE_LINUX_NETWORK)
 		dst_addr.addr.addr6 = ((struct in6_pktinfo *)CMSG_DATA(cmptr))->ipi6_addr;
 		if_index =((struct in6_pktinfo *)CMSG_DATA(cmptr))->ipi6_ifindex;
+  #elif defined(IP_RECVDSTADDR) && defined(IP_RECVIF)
+		dst_addr.addr.addr6 = *((struct in6_addr *)CMSG_DATA(cmptr));
+  #endif
 	      }
 	}
 #endif

Will test the functionality when I have access to an appropriate
machine in an appropriate network.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (600, 'testing'), (110, 'experimental')
Architecture: kfreebsd-i386 (i686)

Kernel: kFreeBSD 8.0-1-686-smp
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#566334; Package dnsmasq. (Sat, 23 Jan 2010 13:15:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Simon Kelley <simon@thekelleys.org.uk>:
Extra info received and forwarded to list. (Sat, 23 Jan 2010 13:15:08 GMT) Full text and rfc822 format available.

Message #10 received at 566334@bugs.debian.org (full text, mbox):

From: Simon Kelley <simon@thekelleys.org.uk>
To: Axel Beckert <abe@deuxchevaux.org>, 566334@bugs.debian.org
Subject: Re: Bug#566334: dnsmasq: FTBFS on kfreebsd
Date: Sat, 23 Jan 2010 12:30:07 +0000
Axel Beckert wrote:
> Package: dnsmasq
> Severity: important
> Tags: patch, ipv6
> User: debian-bsd@lists.debian.org
> Usertags: kfreebsd
> 
> Hi,
> 
> dnsmasq FTBFS on kfreebsd since the IPv6 support in dnsmasq is Linux-only.
> 
> Following a patch which fixes the FTBFS -- hopefully without changing
> the build on Linux. I wasn't able to test the functionality of the
> patch yet since I only have remote access to kfreebsd machines which
> must not run DHCP servers.
> 
> diff -ru dnsmasq-2.51/src/forward.c dnsmasq-2.51+kbsd/src/forward.c
> --- dnsmasq-2.51/src/forward.c	2009-10-13 18:41:27.000000000 +0200
> +++ dnsmasq-2.51+kbsd/src/forward.c	2010-01-23 00:16:14.000000000 +0100
> @@ -40,7 +40,11 @@
>      char control[CMSG_SPACE(sizeof(struct in_addr))];
>  #endif
>  #ifdef HAVE_IPV6
> +  #if defined(HAVE_LINUX_NETWORK)
>      char control6[CMSG_SPACE(sizeof(struct in6_pktinfo))];
> +  #elif defined(IP_SENDSRCADDR)
> +    char control6[CMSG_SPACE(sizeof(struct in6_addr))];
> +  #endif
>  #endif
>    } control_u;
>    
> @@ -82,12 +86,20 @@
>        else
>  #ifdef HAVE_IPV6
>  	{
> +    #if defined(HAVE_LINUX_NETWORK)
>  	  struct in6_pktinfo *pkt = (struct in6_pktinfo *)CMSG_DATA(cmptr);
>  	  pkt->ipi6_ifindex = iface; /* Need iface for IPv6 to handle link-local addrs */
>  	  pkt->ipi6_addr = source->addr.addr6;
>  	  msg.msg_controllen = cmptr->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
>  	  cmptr->cmsg_type = IPV6_PKTINFO;
>  	  cmptr->cmsg_level = IPV6_LEVEL;
> +    #elif defined(IP_SENDSRCADDR)
> +	  struct in6_addr *a = (struct in6_addr *)CMSG_DATA(cmptr);
> +	  *a = source->addr.addr6;
> +	  msg.msg_controllen = cmptr->cmsg_len = CMSG_LEN(sizeof(struct in6_addr));
> +	  cmptr->cmsg_level = IPPROTO_IP;
> +	  cmptr->cmsg_type = IP_SENDSRCADDR;
> +    #endif
>  	}
>  #else
>        iface = 0; /* eliminate warning */
> @@ -575,7 +587,12 @@
>    union {
>      struct cmsghdr align; /* this ensures alignment */
>  #ifdef HAVE_IPV6
> +  #if defined(HAVE_LINUX_NETWORK)
>      char control6[CMSG_SPACE(sizeof(struct in6_pktinfo))];
> +  #elif defined(IP_RECVDSTADDR)
> +    char control6[CMSG_SPACE(sizeof(struct in6_addr)) +
> +		  CMSG_SPACE(sizeof(struct sockaddr_dl))];
> +  #endif
>  #endif
>  #if defined(HAVE_LINUX_NETWORK)
>      char control[CMSG_SPACE(sizeof(struct in_pktinfo))];
> @@ -663,8 +680,12 @@
>  	  for (cmptr = CMSG_FIRSTHDR(&msg); cmptr; cmptr = CMSG_NXTHDR(&msg, cmptr))
>  	    if (cmptr->cmsg_level == IPV6_LEVEL && cmptr->cmsg_type == IPV6_PKTINFO)
>  	      {
> +  #if defined(HAVE_LINUX_NETWORK)
>  		dst_addr.addr.addr6 = ((struct in6_pktinfo *)CMSG_DATA(cmptr))->ipi6_addr;
>  		if_index =((struct in6_pktinfo *)CMSG_DATA(cmptr))->ipi6_ifindex;
> +  #elif defined(IP_RECVDSTADDR) && defined(IP_RECVIF)
> +		dst_addr.addr.addr6 = *((struct in6_addr *)CMSG_DATA(cmptr));
> +  #endif
>  	      }
>  	}
>  #endif
> 
> Will test the functionality when I have access to an appropriate
> machine in an appropriate network.
> 
> -- System Information:
> Debian Release: squeeze/sid
>   APT prefers unstable
>   APT policy: (990, 'unstable'), (600, 'testing'), (110, 'experimental')
> Architecture: kfreebsd-i386 (i686)
> 
> Kernel: kFreeBSD 8.0-1-686-smp
> Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> 
> 
> 


Thanks for this, but I'm not sure it's the correct solution. Getting the
source address in IPv4 hasn't been standardised, and is different
(IP_PKTINFO, SENDSRCADDR, etc) on different platforms. For Ipv6, it _is_
standardised, in RFC 2292 and then RFC 3542. These mandate in6_pktinfo
and all platforms support it. The same code should therefore work on
*BSD and Linux.

Certainly, dnsmasq (without your patch) compiles on real FreeBSD
supports IPv6 fine, and has done for many years. Dnsmasq _used_ to build
fine on kfreeBSD, so the problem looks more like a subtle change
somewhere in the kFreeBSD headers, probably compounded by dnsmasq using
them in a subtly wrong way somewhere. (or maybe when it built, IPv6
support was being excluded, and a change in the headers has brought IPv6
support in and exposed the problem.)

Could you give me net access to a kfreeBSD box, to chase this further?


Cheers,

Simon.







Information forwarded to debian-bugs-dist@lists.debian.org, Simon Kelley <simon@thekelleys.org.uk>:
Bug#566334; Package dnsmasq. (Mon, 25 Jan 2010 17:45:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petr Salinger <Petr.Salinger@seznam.cz>:
Extra info received and forwarded to list. Copy sent to Simon Kelley <simon@thekelleys.org.uk>. (Mon, 25 Jan 2010 17:45:06 GMT) Full text and rfc822 format available.

Message #15 received at 566334@bugs.debian.org (full text, mbox):

From: Petr Salinger <Petr.Salinger@seznam.cz>
To: 566334@bugs.debian.org
Subject: [patch] Bug#566334: dnsmasq: FTBFS on kfreebsd
Date: Mon, 25 Jan 2010 20:46:35 +0100 (CET)
Hi,

> or maybe when it built, IPv6 support was being excluded, and a change in 
> the headers has brought IPv6 support in and exposed the problem.

I expect that it is the cause.
Please just extend the check bellow to get needed types ...

Petr

--- src/dnsmasq.h
+++ src/dnsmasq.h
@@ -23,7 +23,7 @@
 #endif

 /* Get linux C library versions. */
-#ifdef __linux__
+#if defined(__linux__) || defined(__GLIBC__)
 #  define _GNU_SOURCE
 #  include <features.h>
 #endif





Added tag(s) fixed-upstream. Request was from Petr Salinger <Petr.Salinger@seznam.cz> to control@bugs.debian.org. (Fri, 29 Jan 2010 13:33:03 GMT) Full text and rfc822 format available.

Changed Bug submitter to 'Axel Beckert <abe@debian.org>' from 'Axel Beckert <abe@deuxchevaux.org>' Request was from Axel Beckert <abe@debian.org> to control@bugs.debian.org. (Wed, 17 Feb 2010 19:15:33 GMT) Full text and rfc822 format available.

Severity set to 'serious' from 'important' Request was from Clint Adams <schizo@debian.org> to control@bugs.debian.org. (Tue, 23 Mar 2010 01:03:04 GMT) Full text and rfc822 format available.

Added tag(s) sid and squeeze. Request was from Gerfried Fuchs <rhonda@debian.at> to control@bugs.debian.org. (Tue, 23 Mar 2010 07:51:18 GMT) Full text and rfc822 format available.

Severity set to 'important' from 'serious' Request was from Gerfried Fuchs <rhonda@deb.at> to control@bugs.debian.org. (Tue, 23 Mar 2010 08:30:07 GMT) Full text and rfc822 format available.

Reply sent to Simon Kelley <simon@thekelleys.org.uk>:
You have taken responsibility. (Thu, 03 Jun 2010 18:51:12 GMT) Full text and rfc822 format available.

Notification sent to Axel Beckert <abe@debian.org>:
Bug acknowledged by developer. (Thu, 03 Jun 2010 18:51:12 GMT) Full text and rfc822 format available.

Message #30 received at 566334-close@bugs.debian.org (full text, mbox):

From: Simon Kelley <simon@thekelleys.org.uk>
To: 566334-close@bugs.debian.org
Subject: Bug#566334: fixed in dnsmasq 2.53-1
Date: Thu, 03 Jun 2010 18:48:49 +0000
Source: dnsmasq
Source-Version: 2.53-1

We believe that the bug you reported is fixed in the latest version of
dnsmasq, which is due to be installed in the Debian FTP archive:

dnsmasq-base_2.53-1_i386.deb
  to main/d/dnsmasq/dnsmasq-base_2.53-1_i386.deb
dnsmasq_2.53-1.diff.gz
  to main/d/dnsmasq/dnsmasq_2.53-1.diff.gz
dnsmasq_2.53-1.dsc
  to main/d/dnsmasq/dnsmasq_2.53-1.dsc
dnsmasq_2.53-1_all.deb
  to main/d/dnsmasq/dnsmasq_2.53-1_all.deb
dnsmasq_2.53.orig.tar.gz
  to main/d/dnsmasq/dnsmasq_2.53.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 566334@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Simon Kelley <simon@thekelleys.org.uk> (supplier of updated dnsmasq package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


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

Format: 1.8
Date: Thu, 20 May 2010 11:41:23 +0000
Source: dnsmasq
Binary: dnsmasq dnsmasq-base
Architecture: source i386 all
Version: 2.53-1
Distribution: unstable
Urgency: low
Maintainer: Simon Kelley <simon@thekelleys.org.uk>
Changed-By: Simon Kelley <simon@thekelleys.org.uk>
Description: 
 dnsmasq    - A small caching DNS proxy and DHCP/TFTP server
 dnsmasq-base - A small caching DNS proxy and DHCP/TFTP server
Closes: 566334 581064
Changes: 
 dnsmasq (2.53-1) unstable; urgency=low
 .
    * New upstream.
    * Fix FTBFS on kFreeBSD. (closes: #566334)
    * Teach initscript to check the config file syntax before
      restarting dnsmasq. An error will leave the old dnsmasq still
      running, rather than killing the old daemon and then failing to start
      a new one.
    * Tweak DHCP behaviour when a physical interface has two addresses on
      the same subnet. (closes: #581064)
Checksums-Sha1: 
 a50b28af583100cc87139e27d6f3353b1c8c3621 986 dnsmasq_2.53-1.dsc
 a3072d48d8d65adb38fa7021328f6e7c0113e496 435185 dnsmasq_2.53.orig.tar.gz
 c62730379faa1456f5b97e5e78bea1103b747d0f 16131 dnsmasq_2.53-1.diff.gz
 92a9bda720ff22cb8490e59e0e700172fa4128b9 307022 dnsmasq-base_2.53-1_i386.deb
 5e3b9b3b5e3ccd45ca975836c846a515def203f4 14220 dnsmasq_2.53-1_all.deb
Checksums-Sha256: 
 2ee5130938531bb63fd0416103696bbe4db8ebc6e5e5977e0558ab4decd139c3 986 dnsmasq_2.53-1.dsc
 6266c3839cc7b81b3ff48e4bde35c1b430e2f83bd8a55b46babaeeb16e8433d1 435185 dnsmasq_2.53.orig.tar.gz
 a0afd9122268792afca5caa315366ef83dddc71efd8e7ab585cb8578973af278 16131 dnsmasq_2.53-1.diff.gz
 3ab1fe0450b9957b69df3523a556d6b0db2aad4b8d4275ecda7304b6177d2a0d 307022 dnsmasq-base_2.53-1_i386.deb
 c6be840e7674796ccbbed821d358322ca02a91994dbdb287ac56db58b584e691 14220 dnsmasq_2.53-1_all.deb
Files: 
 ab49a4c370c74e3574538ac985b034fe 986 net optional dnsmasq_2.53-1.dsc
 9f66ed5a1d3d7bd1fffd1a4cdc2102b2 435185 net optional dnsmasq_2.53.orig.tar.gz
 95489624bed510fe4b4ce7af32384b99 16131 net optional dnsmasq_2.53-1.diff.gz
 581b3979c01270eaa7953f52f7e7d1bc 307022 net optional dnsmasq-base_2.53-1_i386.deb
 b0ed3758f049b415cae335a421e2072c 14220 net optional dnsmasq_2.53-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkwGq+oACgkQKPyGmiibgreA+ACgihVoxfRQt0AHyL8iQi0hFzXC
g2kAninVEOuKFKQSFHDffYdbg8X/v0Jo
=5wW5
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 06 Jul 2010 07:33:16 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 13:54:36 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.