Browse Source

Use strlcat from libbsd-dev, fixing FTBFS on hurd and kfreebsd. Closes: #832038

Christoph Biedl 7 years ago
parent
commit
f956eaf69a
4 changed files with 38 additions and 2 deletions
  1. 1 0
      debian/control
  2. 2 1
      debian/patches/re-autoconfig.patch
  3. 2 1
      debian/patches/series
  4. 33 0
      debian/patches/use-strlcat.patch

+ 1 - 0
debian/control

@@ -5,6 +5,7 @@ Standards-Version: 3.9.8
 Build-Depends: debhelper (>= 9~),
     asciidoc,
     dh-autoreconf,
+    libbsd-dev,
     libbz2-dev,
     xmlto,
     zlib1g-dev,

+ 2 - 1
debian/patches/re-autoconfig.patch

@@ -22,7 +22,7 @@ Last-Update: 2016-07-20
 +	[ ! -d test_data ] || ./test.sh
 --- /dev/null
 +++ b/configure.ac
-@@ -0,0 +1,42 @@
+@@ -0,0 +1,43 @@
 +AC_REVISION([m4_esyscmd([dpkg-parsechangelog -SVersion])])
 +
 +AC_INIT([libbgpdump], 1.4.99.15, [ris@ripe.net])
@@ -50,6 +50,7 @@ Last-Update: 2016-07-20
 +
 +AC_CHECK_LIB(z, gzopen, [], AC_DEFINE(DONT_HAVE_GZ, 1, Define if libz not present))
 +AC_CHECK_LIB(bz2, BZ2_bzReadOpen, [], AC_DEFINE(DONT_HAVE_BZ2, 1, Define if libbzip2 not present))
++AC_CHECK_LIB(bsd, strlcat)
 +
 +# Check for inet_ntoa in -lnsl if not found (Solaris)
 +AC_CHECK_FUNCS(inet_ntoa, [], AC_CHECK_LIB(nsl, inet_ntoa, [], AC_MSG_ERROR([inet_ntoa not found],1)))

+ 2 - 1
debian/patches/series

@@ -11,9 +11,10 @@ catch-alloc-failures.patch
 add-prototype.patch
 clarify-pointer-cast.patch
 fix-gzfile-type-usage.patch
+fix-sprintf-append.patch
+use-strlcat.patch
 
 # features
-fix-sprintf-append.patch
 increase-max-prefixes.patch
 more-bgp-states.patch
 

+ 33 - 0
debian/patches/use-strlcat.patch

@@ -0,0 +1,33 @@
+Description: Use strlcat provided by libbsd
+Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
+Forwarded: No
+Last-Update: 2016-07-21
+
+--- a/bgpdump_lib.c
++++ b/bgpdump_lib.c
+@@ -37,6 +37,7 @@
+ #include <netinet/in.h>
+ #include <sys/socket.h>
+ #include <arpa/inet.h>
++#include <bsd/string.h>
+ 
+ #include <zlib.h>
+ #include <assert.h>
+@@ -78,7 +79,7 @@
+ 
+ BGPDUMP_TABLE_DUMP_V2_PEER_INDEX_TABLE *table_dump_v2_peer_index_table = NULL;
+ 
+-#if defined(linux)
++#if 0
+ static    size_t strlcat(char *dst, const char *src, size_t size);
+ #endif
+ 
+@@ -1482,7 +1483,7 @@
+   }
+ }
+ 
+-#if defined(linux)
++#if 0
+ size_t strlcat(char *dst, const char *src, size_t size) {
+   if (strlen (dst) + strlen (src) >= size)
+     return -1;