Package: pktstat
Version: 1.8.1-1
Severity: important
Tags: patch

Hi,

currently your package FTBFS on GNU/kFreeBSD with the following error:
> if gcc -DHAVE_CONFIG_H -I. -I. -I.  -DPATH_PKTSTATRC=\"/usr/etc/pktstatrc\"   
> -g -O2 -MT tcp.o -MD -MP -MF ".deps/tcp.Tpo" -c -o tcp.o tcp.c; \
>       then mv -f ".deps/tcp.Tpo" ".deps/tcp.Po"; else rm -f ".deps/tcp.Tpo"; 
> exit 1; fi
> tcp.c: In function 'tcp_tag':
> tcp.c:160: error: 'struct tcphdr' has no member named 'th_sport'
> tcp.c:161: error: 'struct tcphdr' has no member named 'th_dport'
> tcp.c:182: error: 'struct tcphdr' has no member named 'th_flags'
> tcp.c:182: error: 'TH_SYN' undeclared (first use in this function)
> tcp.c:182: error: (Each undeclared identifier is reported only once
> tcp.c:182: error: for each function it appears in.)
> tcp.c:182: error: 'TH_FIN' undeclared (first use in this function)
> tcp.c:182: error: 'TH_RST' undeclared (first use in this function)
> tcp.c:183: error: 'struct tcphdr' has no member named 'th_flags'
> tcp.c:185: error: 'struct tcphdr' has no member named 'th_seq'
> tcp.c:188: error: 'struct tcphdr' has no member named 'th_flags'
> tcp.c:195: error: 'struct tcphdr' has no member named 'th_seq'
> tcp.c:197: error: 'struct tcphdr' has no member named 'th_off'
> make[2]: *** [tcp.o] Error 1

Full build logs are available at
<http://experimental.ftbfs.de/build.php?arch=kfreebsd-i386&pkg=pktstat>.

Please find attached a patch to fix this, based on the __GLIBC__ macro defined
on GNU/k*BSD platforms and on the specific __FreeBSD_kernel__ macro to ensure
that endian-related functions are picked up correctly.

Cheers,

-- 
Cyril Brulebois
--- pktstat-1.8.1/machendian.h  2007-03-16 13:59:41.932513000 +0100
+++ pktstat-1.8.1/machendian.h  2007-03-16 14:00:25.000000000 +0100
@@ -37,7 +37,7 @@
 # endif
 #endif
 
-#if defined(__linux__)
+#if defined(__linux__) || defined(__FreeBSD_kernel__)
 # include <endian.h>
 # include <byteswap.h>
 # define swap16(x) bswap_16(x)
--- pktstat-1.8.1/tcp.c 2007-03-16 13:50:03.577368000 +0100
+++ pktstat-1.8.1/tcp.c 2007-03-16 13:52:57.000000000 +0100
@@ -19,7 +19,7 @@
 #if HAVE_SYS_TIME_H
 # include <sys/time.h>
 #endif
-#if defined(__linux__)
+#if defined(__linux__) || defined(__GLIBC__)
 # define __FAVOR_BSD
 #endif
 #if HAVE_NETINET_IN_H
--- pktstat-1.8.1/udp.c 2007-03-16 13:50:51.474439000 +0100
+++ pktstat-1.8.1/udp.c 2007-03-16 13:53:04.000000000 +0100
@@ -16,7 +16,7 @@
 #if HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
-#if defined(__linux__)
+#if defined(__linux__) || defined(__GLIBC__)
 # define __FAVOR_BSD
 #endif
 #if HAVE_NETINET_IN_H

Reply via email to