summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2021-04-09 20:38:56 +0200
committerDavid Lamparter <equinox@diac24.net>2021-04-09 20:41:57 +0200
commit0490ce41c133f9a801f36668dd58b326ec72a7aa (patch)
tree51c85c94a7b7536e16dcb93bb3ca5ad14d4ffaff
parentbuild: don't link pathd/path_main.c twice (diff)
downloadfrr-0490ce41c133f9a801f36668dd58b326ec72a7aa.tar.xz
frr-0490ce41c133f9a801f36668dd58b326ec72a7aa.zip
pceplib: add missing endian.h and config.h
endian.h supplies be*toh() and htobe*() functions. This fixes the build on musl libc. On other systems it seems endian.h comes in transitively from some other header. (Also, all .c files should have config.h or zebra.h as the first include, even if it works without that it's b0rked and only works due to luck.) Tested-by: Lucian Cristian <lucian.cristian@gmail.com> Signed-off-by: David Lamparter <equinox@diac24.net>
-rw-r--r--pceplib/pcep_msg_tlvs_encoding.c9
-rw-r--r--pceplib/test/pcep_msg_tlvs_test.c9
2 files changed, 18 insertions, 0 deletions
diff --git a/pceplib/pcep_msg_tlvs_encoding.c b/pceplib/pcep_msg_tlvs_encoding.c
index 967f13814..37f3353f7 100644
--- a/pceplib/pcep_msg_tlvs_encoding.c
+++ b/pceplib/pcep_msg_tlvs_encoding.c
@@ -25,6 +25,15 @@
* Encoding and decoding for PCEP Object TLVs.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef __FreeBSD__
+#include <sys/endian.h>
+#else
+#include <endian.h>
+#endif /* __FreeBSD__ */
#include <stdlib.h>
#include <string.h>
diff --git a/pceplib/test/pcep_msg_tlvs_test.c b/pceplib/test/pcep_msg_tlvs_test.c
index 6b650f682..57e1d16e9 100644
--- a/pceplib/test/pcep_msg_tlvs_test.c
+++ b/pceplib/test/pcep_msg_tlvs_test.c
@@ -21,6 +21,15 @@
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef __FreeBSD__
+#include <sys/endian.h>
+#else
+#include <endian.h>
+#endif /* __FreeBSD__ */
#include <stdlib.h>
#include <CUnit/CUnit.h>