Bug#760375: radvd: FTBFS on x32 due to lack of sysctl

2014-09-05 Thread Thorsten Glaser
Daniel Schepler dixit:

It would probably be a better idea to remove the sysctl(2) code altogether, as

No, because sysctl is perfectly fine for use e.g. in chroots or on
systems where Linux procfs has not been mounted, e.g. to gather
some entropy in the absence of /dev/urandom (from random_uuid),
or other cases. (Speaking as a BSD developer.)

the kernel support is unmaintained anyway, and as I understand it the kernel
complains to the dmesg log if sysctl is ever actually used.

Still, removing it for architectures where it worked before is
a regression. Also, whenever the Linux kernel developers gain
some sense, they can just add sysctl to x32 and it will work.

Also, more realistically, I prefer to provide minimal-invasive
patches to upstream first, and do things like this only later
or leave them up to upstream, especially if they have political
dimensions.

bye,
//mirabilos
-- 
13:37⎜«Natureshadow» Deep inside, I hate mirabilos. I mean, he's a good
guy. But he's always right! In every fsckin' situation, he's right. Even
with his deeply perverted taste in software and borked ambition towards
broken OSes - in the end, he's damn right about it :(! […] works in mksh


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#760375: radvd: FTBFS on x32 due to lack of sysctl

2014-09-04 Thread Daniel Schepler
On Wednesday, September 03, 2014 02:05:05 PM Thorsten Glaser wrote:
 attached patch fixes the issue by autoconf’ing sysctl(2) and
 disabling the use of it if it’s not there, such as on x32,
 and probably arm64.

It would probably be a better idea to remove the sysctl(2) code altogether, as 
the kernel support is unmaintained anyway, and as I understand it the kernel 
complains to the dmesg log if sysctl is ever actually used.

(Although I don't see any arm64 failures related to sysctl, so I guess arm64 
somehow got sysctl support.)
-- 
Daniel Schepler


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#760375: radvd: FTBFS on x32 due to lack of sysctl

2014-09-03 Thread Thorsten Glaser
Source: radvd
Version: 1:1.9.1-1.3
Severity: important
Tags: patch
Justification: fails to build from source

Hi,

attached patch fixes the issue by autoconf’ing sysctl(2) and
disabling the use of it if it’s not there, such as on x32,
and probably arm64.

Please apply.

-- System Information:
Debian Release: jessie/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: x32 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/lksh
diff -Nru radvd-1.9.1/debian/changelog radvd-1.9.1/debian/changelog
--- radvd-1.9.1/debian/changelog	2014-08-05 17:47:20.0 +0200
+++ radvd-1.9.1/debian/changelog	2014-09-03 12:47:34.0 +0200
@@ -1,3 +1,9 @@
+radvd (1:1.9.1-1.3+x32.1) unreleased; urgency=medium
+
+  * Work around lack of sysctl(2) in x32 (which I disagree with)
+
+ -- Thorsten Glaser t...@mirbsd.de  Wed, 03 Sep 2014 12:47:33 +0200
+
 radvd (1:1.9.1-1.3) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru radvd-1.9.1/debian/patches/series radvd-1.9.1/debian/patches/series
--- radvd-1.9.1/debian/patches/series	2012-01-23 18:05:54.0 +0100
+++ radvd-1.9.1/debian/patches/series	2014-09-03 12:38:19.0 +0200
@@ -2,3 +2,4 @@
 0006-removing-mdelay-in-unicast-only-case.patch
 0007-checking-iface-name-more-carefully.patch
 kfreebsd.patch
+x32.patch
diff -Nru radvd-1.9.1/debian/patches/x32.patch radvd-1.9.1/debian/patches/x32.patch
--- radvd-1.9.1/debian/patches/x32.patch	1970-01-01 01:00:00.0 +0100
+++ radvd-1.9.1/debian/patches/x32.patch	2014-09-03 12:47:33.0 +0200
@@ -0,0 +1,50 @@
+--- a/configure.ac
 b/configure.ac
+@@ -179,7 +179,7 @@ int u =  in6_u.s6_addr16;], [AC_MSG_RESU
+ AC_MSG_RESULT(no))
+ 
+ dnl Checks for library functions.
+-AC_CHECK_FUNCS(getopt_long)
++AC_CHECK_FUNCS([getopt_long sysctl])
+ 
+ CONDITIONAL_SOURCES=device-${arch}.${OBJEXT} ${CONDITIONAL_SOURCES}
+ if test x${arch} = xlinux ; then
+--- a/includes.h
 b/includes.h
+@@ -72,7 +72,9 @@
+ 
+ #include arpa/inet.h
+ 
++#ifdef HAVE_SYSCTL
+ #include sys/sysctl.h
++#endif
+ 
+ #include net/if.h
+ 
+--- a/radvd.c
 b/radvd.c
+@@ -763,7 +763,9 @@ check_conffile_perm(const char *username
+ int
+ check_ip6_forwarding(void)
+ {
++#ifdef HAVE_SYSCTL
+ 	int forw_sysctl[] = { SYSCTL_IP6_FORWARDING };
++#endif
+ 	int value;
+ 	size_t size = sizeof(value);
+ 	FILE *fp = NULL;
+@@ -785,8 +787,12 @@ check_ip6_forwarding(void)
+ 	or the kernel interface has changed?);
+ #endif /* __linux__ */
+ 
+-	if (!fp  sysctl(forw_sysctl, sizeof(forw_sysctl)/sizeof(forw_sysctl[0]),
+-	value, size, NULL, 0)  0) {
++	if (!fp
++#ifdef HAVE_SYSCTL
++	 sysctl(forw_sysctl, sizeof(forw_sysctl)/sizeof(forw_sysctl[0]),
++	value, size, NULL, 0)  0
++#endif
++	) {
+ 		flog(LOG_DEBUG, Correct IPv6 forwarding sysctl branch not found, 
+ 			perhaps the kernel interface has changed?);
+ 		return(0);	/* this is of advisory value only */