summaryrefslogtreecommitdiff
path: root/pceplib/pcep_msg_tlvs_encoding.c
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 /pceplib/pcep_msg_tlvs_encoding.c
parent636aad94735aff8aeec911bca4c32f4e5e48d77c (diff)
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>
Diffstat (limited to 'pceplib/pcep_msg_tlvs_encoding.c')
-rw-r--r--pceplib/pcep_msg_tlvs_encoding.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/pceplib/pcep_msg_tlvs_encoding.c b/pceplib/pcep_msg_tlvs_encoding.c
index 967f138143..37f3353f76 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>