use-libbsd.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Description: Use strlcat provided by libbsd
  2. Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
  3. Forwarded: No
  4. Last-Update: 2017-11-18
  5. --- a/configure.in
  6. +++ b/configure.in
  7. @@ -25,6 +25,7 @@
  8. AC_CHECK_LIB(z, gzopen, [], AC_MSG_ERROR([libz not found],1))
  9. AC_CHECK_LIB(bz2, BZ2_bzReadOpen, [], AC_MSG_ERROR([libbzip2 not found],1))
  10. +AC_CHECK_LIB(bsd, strlcat, [], AC_MSG_ERROR([libsd not found],1))
  11. # Check for inet_ntoa in -lnsl if not found (Solaris)
  12. AC_CHECK_FUNCS(inet_ntoa, [], AC_CHECK_LIB(nsl, inet_ntoa, [], AC_MSG_ERROR([inet_ntoa not found],1)))
  13. --- a/bgpdump_lib.c
  14. +++ b/bgpdump_lib.c
  15. @@ -37,6 +37,7 @@
  16. #include <netinet/in.h>
  17. #include <sys/socket.h>
  18. #include <arpa/inet.h>
  19. +#include <bsd/string.h>
  20. #include <zlib.h>
  21. #include <assert.h>
  22. @@ -77,7 +78,7 @@
  23. static struct aspath *asn32_merge_paths(struct aspath *path, struct aspath *newpath);
  24. static void asn32_expand_16_to_32(char *dst, char *src, int len);
  25. -#if defined(linux)
  26. +#if 0
  27. static size_t strlcat(char *dst, const char *src, size_t size);
  28. #endif
  29. @@ -1689,7 +1690,7 @@
  30. }
  31. }
  32. -#if defined(linux)
  33. +#if 0
  34. size_t strlcat(char *dst, const char *src, size_t size) {
  35. if (strlen (dst) + strlen (src) >= size)
  36. return -1;