summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-01-11 14:50:21 +0200
committerGitHub <noreply@github.com>2024-01-11 14:50:21 +0200
commit67e8ef293f03b2dfd52981c7d82fbc98716fa1e5 (patch)
tree3c1d816e4f15c9a5c5332750b06216dadcf2be6f
parent5fbf0cc00dd751442108990026607740ff3d49d9 (diff)
parentc402a0bdc1c5bfaa9b222fb213315ebd2ff7bff3 (diff)
Merge pull request #15098 from donaldsharp/lib_zebra_h_cleanup_2
Lib zebra h cleanup 2
-rw-r--r--babeld/babel_main.c2
-rw-r--r--babeld/kernel.c1
-rw-r--r--bfdd/control.c3
-rw-r--r--bgpd/bgp_btoa.c1
-rw-r--r--bgpd/bgp_dump.c1
-rw-r--r--isisd/isis_bpf.c3
-rw-r--r--ldpd/control.c1
-rw-r--r--ldpd/ldpd.c3
-rw-r--r--ldpd/socket.c1
-rw-r--r--lib/agentx.c1
-rw-r--r--lib/command.c3
-rw-r--r--lib/event.c2
-rw-r--r--lib/frr_pthread.c3
-rw-r--r--lib/libfrr.c4
-rw-r--r--lib/mgmt_msg.c2
-rw-r--r--lib/netns_linux.c1
-rw-r--r--lib/network.c1
-rw-r--r--lib/northbound_cli.c1
-rw-r--r--lib/pid_output.c1
-rw-r--r--lib/privs.c1
-rw-r--r--lib/sigevent.c2
-rw-r--r--lib/sockunion.h1
-rw-r--r--lib/systemd.c1
-rw-r--r--lib/vector.c1
-rw-r--r--lib/vty.c2
-rw-r--r--lib/zebra.h18
-rw-r--r--lib/zlog.c2
-rw-r--r--lib/zlog_5424.c1
-rw-r--r--lib/zlog_targets.c1
-rw-r--r--nhrpd/linux.c1
-rw-r--r--nhrpd/vici.c1
-rw-r--r--ospf6d/ospf6_auth_trailer.c1
-rw-r--r--ospfd/ospf_auth.c1
-rw-r--r--pimd/pim_sock.c1
-rw-r--r--tests/bgpd/test_packet.c1
-rw-r--r--tests/helpers/c/main.c1
-rw-r--r--tests/isisd/test_isis_spf.c1
-rw-r--r--tests/lib/cli/common_cli.c1
-rw-r--r--tests/lib/northbound/test_oper_data.c1
-rw-r--r--tests/lib/test_privs.c1
-rw-r--r--tests/ospfd/test_ospf_spf.c1
-rw-r--r--tools/gen_northbound_callbacks.c1
-rw-r--r--vtysh/vtysh.c1
-rw-r--r--vtysh/vtysh_main.c2
-rw-r--r--watchfrr/watchfrr.c5
-rw-r--r--watchfrr/watchfrr_vty.c2
-rw-r--r--zebra/if_sysctl.c2
-rw-r--r--zebra/kernel_netlink.c1
-rw-r--r--zebra/kernel_socket.c2
-rw-r--r--zebra/netconf_netlink.c1
-rw-r--r--zebra/rt_socket.c2
-rw-r--r--zebra/rtread_sysctl.c2
-rw-r--r--zebra/zebra_mpls_netlink.c1
-rw-r--r--zebra/zebra_netns_id.c2
-rw-r--r--zebra/zebra_netns_notify.c1
55 files changed, 84 insertions, 18 deletions
diff --git a/babeld/babel_main.c b/babeld/babel_main.c
index c751e49651..7122d6953b 100644
--- a/babeld/babel_main.c
+++ b/babeld/babel_main.c
@@ -5,6 +5,8 @@ Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
/* include zebra library */
#include <zebra.h>
+#include <fcntl.h>
+
#include "getopt.h"
#include "if.h"
#include "log.h"
diff --git a/babeld/kernel.c b/babeld/kernel.c
index 4fe5bcfea6..aed6dc9c4f 100644
--- a/babeld/kernel.c
+++ b/babeld/kernel.c
@@ -11,6 +11,7 @@ Copyright 2011, 2012 by Matthieu Boutier and Juliusz Chroboczek
#include <sys/time.h>
#include <sys/param.h>
#include <time.h>
+#include <fcntl.h>
#include "babeld.h"
diff --git a/bfdd/control.c b/bfdd/control.c
index f435358f33..6ff86f2913 100644
--- a/bfdd/control.c
+++ b/bfdd/control.c
@@ -12,6 +12,9 @@
#include <zebra.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
#include <sys/un.h>
#include "bfd.h"
diff --git a/bgpd/bgp_btoa.c b/bgpd/bgp_btoa.c
index 8e27d9769f..1d5034efd2 100644
--- a/bgpd/bgp_btoa.c
+++ b/bgpd/bgp_btoa.c
@@ -4,6 +4,7 @@
*/
#include <zebra.h>
+#include <fcntl.h>
#include "zebra.h"
#include "stream.h"
diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c
index 529713ee32..53b5212482 100644
--- a/bgpd/bgp_dump.c
+++ b/bgpd/bgp_dump.c
@@ -4,6 +4,7 @@
*/
#include <zebra.h>
+#include <sys/stat.h>
#include "log.h"
#include "stream.h"
diff --git a/isisd/isis_bpf.c b/isisd/isis_bpf.c
index 96d629124d..47f51a7548 100644
--- a/isisd/isis_bpf.c
+++ b/isisd/isis_bpf.c
@@ -8,6 +8,9 @@
*/
#include <zebra.h>
+
+#include <fcntl.h>
+
#if ISIS_METHOD == ISIS_METHOD_BPF
#include <net/if.h>
#include <netinet/if_ether.h>
diff --git a/ldpd/control.c b/ldpd/control.c
index db52d46325..a08ce4cc1a 100644
--- a/ldpd/control.c
+++ b/ldpd/control.c
@@ -6,6 +6,7 @@
*/
#include <zebra.h>
+#include <sys/stat.h>
#include <sys/un.h>
#include "ldpd.h"
diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c
index 3c616d4a8c..a4d45d9c8d 100644
--- a/ldpd/ldpd.c
+++ b/ldpd/ldpd.c
@@ -9,6 +9,9 @@
*/
#include <zebra.h>
+
+#include <signal.h>
+#include <fcntl.h>
#include <sys/wait.h>
#include "ldpd.h"
diff --git a/ldpd/socket.c b/ldpd/socket.c
index 6b7e475d7f..71d5c21753 100644
--- a/ldpd/socket.c
+++ b/ldpd/socket.c
@@ -9,6 +9,7 @@
*/
#include <zebra.h>
+#include <fcntl.h>
#include "ldpd.h"
#include "ldpe.h"
diff --git a/lib/agentx.c b/lib/agentx.c
index c2f2112d7d..70ee6753ff 100644
--- a/lib/agentx.c
+++ b/lib/agentx.c
@@ -4,6 +4,7 @@
*/
#include <zebra.h>
+#include <fcntl.h>
#ifdef SNMP_AGENTX
#include <net-snmp/net-snmp-config.h>
diff --git a/lib/command.c b/lib/command.c
index b33998839b..becba8452b 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -11,6 +11,9 @@
#include <zebra.h>
#include <sys/utsname.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
#include <lib/version.h>
#include "command.h"
diff --git a/lib/event.c b/lib/event.c
index 3ca27f6d8c..a7851f6983 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -6,6 +6,8 @@
/* #define DEBUG */
#include <zebra.h>
+
+#include <signal.h>
#include <sys/resource.h>
#include "frrevent.h"
diff --git a/lib/frr_pthread.c b/lib/frr_pthread.c
index c4ead01bf6..761969266a 100644
--- a/lib/frr_pthread.c
+++ b/lib/frr_pthread.c
@@ -5,6 +5,9 @@
*/
#include <zebra.h>
+
+#include <signal.h>
+
#include <pthread.h>
#ifdef HAVE_PTHREAD_NP_H
#include <pthread_np.h>
diff --git a/lib/libfrr.c b/lib/libfrr.c
index e80355f3b8..d38b4ec4c0 100644
--- a/lib/libfrr.c
+++ b/lib/libfrr.c
@@ -6,7 +6,11 @@
*/
#include <zebra.h>
+
+#include <signal.h>
+#include <sys/stat.h>
#include <sys/un.h>
+#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
diff --git a/lib/mgmt_msg.c b/lib/mgmt_msg.c
index 782707b463..aff9af7e84 100644
--- a/lib/mgmt_msg.c
+++ b/lib/mgmt_msg.c
@@ -7,6 +7,8 @@
* Copyright (c) 2023, LabN Consulting, L.L.C.
*/
#include <zebra.h>
+#include <sys/stat.h>
+
#include "debug.h"
#include "network.h"
#include "sockopt.h"
diff --git a/lib/netns_linux.c b/lib/netns_linux.c
index bebb5c1f77..8fa4bc6fe0 100644
--- a/lib/netns_linux.c
+++ b/lib/netns_linux.c
@@ -5,6 +5,7 @@
*/
#include <zebra.h>
+#include <fcntl.h>
#ifdef HAVE_NETNS
#undef _GNU_SOURCE
diff --git a/lib/network.c b/lib/network.c
index af1c7db443..b768693889 100644
--- a/lib/network.c
+++ b/lib/network.c
@@ -5,6 +5,7 @@
*/
#include <zebra.h>
+#include <fcntl.h>
#include "log.h"
#include "network.h"
#include "lib_errors.h"
diff --git a/lib/northbound_cli.c b/lib/northbound_cli.c
index 20f030e280..92d4ffb2ba 100644
--- a/lib/northbound_cli.c
+++ b/lib/northbound_cli.c
@@ -5,6 +5,7 @@
*/
#include <zebra.h>
+#include <sys/stat.h>
#include "libfrr.h"
#include "lib/version.h"
diff --git a/lib/pid_output.c b/lib/pid_output.c
index 064a7bb47f..ce1b7d1969 100644
--- a/lib/pid_output.c
+++ b/lib/pid_output.c
@@ -5,6 +5,7 @@
*/
#include <zebra.h>
+#include <sys/stat.h>
#include <fcntl.h>
#include <log.h>
#include "lib/version.h"
diff --git a/lib/privs.c b/lib/privs.c
index ef4a0adf04..717a2e48d6 100644
--- a/lib/privs.c
+++ b/lib/privs.c
@@ -7,6 +7,7 @@
*/
#include <zebra.h>
+#include <pwd.h>
#include <grp.h>
#ifdef HAVE_LCAPS
diff --git a/lib/sigevent.c b/lib/sigevent.c
index 3cd65eb800..06f80db4cc 100644
--- a/lib/sigevent.c
+++ b/lib/sigevent.c
@@ -4,6 +4,8 @@
*/
#include <zebra.h>
+
+#include <signal.h>
#include <sigevent.h>
#include <log.h>
#include <memory.h>
diff --git a/lib/sockunion.h b/lib/sockunion.h
index 675855e2b6..146651225c 100644
--- a/lib/sockunion.h
+++ b/lib/sockunion.h
@@ -13,6 +13,7 @@
#include "if.h"
#include <sys/un.h>
#ifdef __OpenBSD__
+#include <net/route.h>
#include <netmpls/mpls.h>
#endif
diff --git a/lib/systemd.c b/lib/systemd.c
index 56a53a6e78..a82c376cfd 100644
--- a/lib/systemd.c
+++ b/lib/systemd.c
@@ -5,6 +5,7 @@
*/
#include <zebra.h>
+#include <sys/stat.h>
#include <sys/un.h>
#include "frrevent.h"
diff --git a/lib/vector.c b/lib/vector.c
index bbea67c12f..60d383101a 100644
--- a/lib/vector.c
+++ b/lib/vector.c
@@ -4,6 +4,7 @@
*/
#include <zebra.h>
+#include <string.h>
#include "vector.h"
#include "memory.h"
diff --git a/lib/vty.c b/lib/vty.c
index 0ee610e3aa..c7029bdcbb 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -6,6 +6,8 @@
#include <zebra.h>
+#include <fcntl.h>
+#include <sys/stat.h>
#include <lib/version.h>
#include <sys/types.h>
#include <sys/types.h>
diff --git a/lib/zebra.h b/lib/zebra.h
index 06be33f5dd..8b0800c257 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -17,16 +17,9 @@
#include <stdlib.h>
#include <stddef.h>
#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <string.h>
-#include <pwd.h>
#ifdef HAVE_STROPTS_H
#include <stropts.h>
#endif /* HAVE_STROPTS_H */
-#include <sys/select.h>
-#include <sys/stat.h>
#include <sys/types.h>
#include <sys/param.h>
#ifdef HAVE_SYS_SYSCTL_H
@@ -44,9 +37,7 @@
#endif /* HAVE_SYS_KSYM_H */
#include <sys/time.h>
#include <time.h>
-#include <limits.h>
#include <inttypes.h>
-#include <stdbool.h>
#ifdef HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
#endif
@@ -92,8 +83,6 @@
#include <net/if_var.h>
#endif /* HAVE_NET_IF_VAR_H */
-#include <net/route.h>
-
#ifndef HAVE_NETLINK
#define RT_TABLE_MAIN 0
#define RT_TABLE_LOCAL RT_TABLE_MAIN
@@ -122,7 +111,6 @@
#include <netinet6/in.h>
#endif /* HAVE_NETINET6_IN_H */
-
#ifdef HAVE_NETINET6_IP6_H
#include <netinet6/ip6.h>
#endif /* HAVE_NETINET6_IP6_H */
@@ -236,12 +224,6 @@ struct in_pktinfo {
/* default zebra TCP port for zclient */
#define ZEBRA_PORT 2600
-/*
- * The compiler.h header is used for anyone using the CPP_NOTICE
- * since this is universally needed, let's add it to zebra.h
- */
-#include "compiler.h"
-
/* Zebra route's types are defined in route_types.h */
#include "lib/route_types.h"
diff --git a/lib/zlog.c b/lib/zlog.c
index 446bdd7021..77592c33ff 100644
--- a/lib/zlog.c
+++ b/lib/zlog.c
@@ -4,6 +4,8 @@
*/
#include "zebra.h"
+#include <sys/stat.h>
+#include <fcntl.h>
#ifdef HAVE_GLIBC_BACKTRACE
#include <execinfo.h>
diff --git a/lib/zlog_5424.c b/lib/zlog_5424.c
index 2158a71360..4c60d4b405 100644
--- a/lib/zlog_5424.c
+++ b/lib/zlog_5424.c
@@ -13,6 +13,7 @@
*/
#include "zebra.h"
+#include <fcntl.h>
#include "frrsendmmsg.h"
diff --git a/lib/zlog_targets.c b/lib/zlog_targets.c
index b0f7571492..bbd228f28c 100644
--- a/lib/zlog_targets.c
+++ b/lib/zlog_targets.c
@@ -5,6 +5,7 @@
#include "zebra.h"
+#include <fcntl.h>
#include <sys/un.h>
#include <syslog.h>
diff --git a/nhrpd/linux.c b/nhrpd/linux.c
index 2a255c435c..b25df9ff2f 100644
--- a/nhrpd/linux.c
+++ b/nhrpd/linux.c
@@ -5,6 +5,7 @@
#include "zebra.h"
+#include <fcntl.h>
#include <errno.h>
#include <linux/if_packet.h>
#include <sys/ioctl.h>
diff --git a/nhrpd/vici.c b/nhrpd/vici.c
index 2f76362603..8162ac06a6 100644
--- a/nhrpd/vici.c
+++ b/nhrpd/vici.c
@@ -10,6 +10,7 @@
#include <string.h>
#include <sys/socket.h>
#include <sys/un.h>
+#include <fcntl.h>
#include "frrevent.h"
#include "zbuf.h"
diff --git a/ospf6d/ospf6_auth_trailer.c b/ospf6d/ospf6_auth_trailer.c
index 82671eef77..54b951654a 100644
--- a/ospf6d/ospf6_auth_trailer.c
+++ b/ospf6d/ospf6_auth_trailer.c
@@ -4,6 +4,7 @@
*/
#include "zebra.h"
+#include <sys/stat.h>
#ifdef CRYPTO_OPENSSL
#include <openssl/evp.h>
diff --git a/ospfd/ospf_auth.c b/ospfd/ospf_auth.c
index 74dc7d556b..2b090dca1e 100644
--- a/ospfd/ospf_auth.c
+++ b/ospfd/ospf_auth.c
@@ -5,6 +5,7 @@
*/
#include <zebra.h>
+#include <sys/stat.h>
#ifdef CRYPTO_OPENSSL
#include <openssl/evp.h>
diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c
index 6c65c5d3e9..3476c177b7 100644
--- a/pimd/pim_sock.c
+++ b/pimd/pim_sock.c
@@ -5,6 +5,7 @@
*/
#include <zebra.h>
+#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/tests/bgpd/test_packet.c b/tests/bgpd/test_packet.c
index a83276be07..e050fd4c71 100644
--- a/tests/bgpd/test_packet.c
+++ b/tests/bgpd/test_packet.c
@@ -7,6 +7,7 @@
*/
#include <zebra.h>
+#include <fcntl.h>
#include "qobj.h"
#include "vty.h"
diff --git a/tests/helpers/c/main.c b/tests/helpers/c/main.c
index 8af53a2ea4..fdda7f1e2a 100644
--- a/tests/helpers/c/main.c
+++ b/tests/helpers/c/main.c
@@ -3,6 +3,7 @@
*/
#include <zebra.h>
+#include <sys/stat.h>
#include <lib/version.h>
#include "getopt.h"
diff --git a/tests/isisd/test_isis_spf.c b/tests/isisd/test_isis_spf.c
index 6eb180b501..95f045c90d 100644
--- a/tests/isisd/test_isis_spf.c
+++ b/tests/isisd/test_isis_spf.c
@@ -5,6 +5,7 @@
*/
#include <zebra.h>
+#include <sys/stat.h>
#include <lib/version.h>
#include "getopt.h"
diff --git a/tests/lib/cli/common_cli.c b/tests/lib/cli/common_cli.c
index e0981b991a..f9f584f450 100644
--- a/tests/lib/cli/common_cli.c
+++ b/tests/lib/cli/common_cli.c
@@ -7,6 +7,7 @@
*/
#include <zebra.h>
+#include <sys/stat.h>
#include "frrevent.h"
#include "vty.h"
diff --git a/tests/lib/northbound/test_oper_data.c b/tests/lib/northbound/test_oper_data.c
index f82eddd3bf..9ac75da4fe 100644
--- a/tests/lib/northbound/test_oper_data.c
+++ b/tests/lib/northbound/test_oper_data.c
@@ -5,6 +5,7 @@
*/
#include <zebra.h>
+#include <sys/stat.h>
#include "frrevent.h"
#include "vty.h"
diff --git a/tests/lib/test_privs.c b/tests/lib/test_privs.c
index e26754857b..caf55c718f 100644
--- a/tests/lib/test_privs.c
+++ b/tests/lib/test_privs.c
@@ -3,6 +3,7 @@
*/
#include <zebra.h>
+#include <sys/stat.h>
#include <lib/version.h>
#include "getopt.h"
diff --git a/tests/ospfd/test_ospf_spf.c b/tests/ospfd/test_ospf_spf.c
index fc6b8e89ec..932763100b 100644
--- a/tests/ospfd/test_ospf_spf.c
+++ b/tests/ospfd/test_ospf_spf.c
@@ -1,4 +1,5 @@
#include <zebra.h>
+#include <sys/stat.h>
#include "getopt.h"
#include "frrevent.h"
diff --git a/tools/gen_northbound_callbacks.c b/tools/gen_northbound_callbacks.c
index 5b778a1585..993aa34209 100644
--- a/tools/gen_northbound_callbacks.c
+++ b/tools/gen_northbound_callbacks.c
@@ -7,6 +7,7 @@
#define REALLY_NEED_PLAIN_GETOPT 1
#include <zebra.h>
+#include <sys/stat.h>
#include <unistd.h>
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index e6ab22450f..2888403e62 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -5,6 +5,7 @@
#include <zebra.h>
+#include <pwd.h>
#include <grp.h>
#include <sys/un.h>
diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c
index c57e8c7997..6065776f11 100644
--- a/vtysh/vtysh_main.c
+++ b/vtysh/vtysh_main.c
@@ -5,6 +5,8 @@
#include <zebra.h>
+#include <signal.h>
+#include <sys/stat.h>
#include <sys/un.h>
#include <setjmp.h>
#include <pwd.h>
diff --git a/watchfrr/watchfrr.c b/watchfrr/watchfrr.c
index 73a033170c..707e01f4ef 100644
--- a/watchfrr/watchfrr.c
+++ b/watchfrr/watchfrr.c
@@ -6,6 +6,11 @@
*/
#include <zebra.h>
+
+#include <signal.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
#include "frrevent.h"
#include <log.h>
#include <network.h>
diff --git a/watchfrr/watchfrr_vty.c b/watchfrr/watchfrr_vty.c
index 3afc76761d..0547c1e8b3 100644
--- a/watchfrr/watchfrr_vty.c
+++ b/watchfrr/watchfrr_vty.c
@@ -6,6 +6,8 @@
*/
#include <zebra.h>
+
+#include <signal.h>
#include <sys/wait.h>
#include "memory.h"
diff --git a/zebra/if_sysctl.c b/zebra/if_sysctl.c
index ae292689ed..9db959896e 100644
--- a/zebra/if_sysctl.c
+++ b/zebra/if_sysctl.c
@@ -6,6 +6,8 @@
#include <zebra.h>
+#include <net/route.h>
+
#if !defined(GNU_LINUX) && !defined(OPEN_BSD)
#include "if.h"
diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c
index a05f2d3edc..8a64a1ea48 100644
--- a/zebra/kernel_netlink.c
+++ b/zebra/kernel_netlink.c
@@ -4,6 +4,7 @@
*/
#include <zebra.h>
+#include <fcntl.h>
#ifdef HAVE_NETLINK
#include <linux/netlink.h>
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index b90be76e46..d50e7de229 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -5,6 +5,8 @@
#include <zebra.h>
+#include <net/route.h>
+
#ifndef HAVE_NETLINK
#include <net/if_types.h>
diff --git a/zebra/netconf_netlink.c b/zebra/netconf_netlink.c
index 9a0b3c5d0c..002d2c7bf6 100644
--- a/zebra/netconf_netlink.c
+++ b/zebra/netconf_netlink.c
@@ -6,6 +6,7 @@
* Donald Sharp
*/
#include <zebra.h>
+#include <fcntl.h>
#ifdef HAVE_NETLINK /* Netlink OSes only */
diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c
index f9888b12d4..0bfcd518ca 100644
--- a/zebra/rt_socket.c
+++ b/zebra/rt_socket.c
@@ -6,6 +6,8 @@
#include <zebra.h>
+#include <net/route.h>
+
#ifndef HAVE_NETLINK
#ifdef __OpenBSD__
diff --git a/zebra/rtread_sysctl.c b/zebra/rtread_sysctl.c
index ef1e21b4f7..8e2d13faff 100644
--- a/zebra/rtread_sysctl.c
+++ b/zebra/rtread_sysctl.c
@@ -6,6 +6,8 @@
#include <zebra.h>
+#include <net/route.h>
+
#if !defined(GNU_LINUX)
#include "memory.h"
diff --git a/zebra/zebra_mpls_netlink.c b/zebra/zebra_mpls_netlink.c
index b76640743e..f0f2c4b7a3 100644
--- a/zebra/zebra_mpls_netlink.c
+++ b/zebra/zebra_mpls_netlink.c
@@ -4,6 +4,7 @@
*/
#include <zebra.h>
+#include <sys/stat.h>
#ifdef HAVE_NETLINK
diff --git a/zebra/zebra_netns_id.c b/zebra/zebra_netns_id.c
index ae8f9d9a8d..1af3a3e857 100644
--- a/zebra/zebra_netns_id.c
+++ b/zebra/zebra_netns_id.c
@@ -5,6 +5,8 @@
*/
#include <zebra.h>
+#include <sys/stat.h>
+#include <fcntl.h>
#ifdef GNU_LINUX
#include <linux/if_link.h>
diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c
index 4260d29c43..1bb1292e34 100644
--- a/zebra/zebra_netns_notify.c
+++ b/zebra/zebra_netns_notify.c
@@ -5,6 +5,7 @@
*/
#include <zebra.h>
+#include <fcntl.h>
#ifdef HAVE_NETLINK
#ifdef HAVE_NETNS