summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2018-08-28 10:57:13 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2018-09-08 21:30:42 +0200
commitb45ac5f5c61f98b0aacf65b456547142193ae1fc (patch)
treecc932f64c64d19ce520e6947f80ab181c3a741b5
parentdbac691da646e624addc8f3ed5e744f9d3f8d69f (diff)
*: fix config.h/zebra.h include order
config.h (or, transitively, zebra.h) must be the first include file listed for autoconf things like _GNU_SOURCE and _POSIX_C_SOURCE to work correctly. Signed-off-by: David Lamparter <equinox@diac24.net>
-rw-r--r--babeld/babel_filter.c4
-rw-r--r--babeld/kernel.c4
-rw-r--r--babeld/neighbour.c4
-rw-r--r--babeld/net.c4
-rw-r--r--babeld/resend.c4
-rw-r--r--babeld/source.c4
-rw-r--r--babeld/util.c4
-rw-r--r--bgpd/bgp_flowspec.c4
-rw-r--r--bgpd/rfapi/rfapi.c3
-rw-r--r--bgpd/rfapi/rfapi_ap.c2
-rw-r--r--bgpd/rfapi/rfapi_descriptor_rfp_utils.c3
-rw-r--r--bgpd/rfapi/rfapi_import.c2
-rw-r--r--bgpd/rfapi/rfapi_monitor.c2
-rw-r--r--bgpd/rfapi/rfapi_rib.c2
-rw-r--r--bgpd/rfapi/rfapi_vty.c3
-rw-r--r--bgpd/rfp-example/librfp/rfp_example.c4
-rw-r--r--bgpd/rfp-example/rfptest/rfptest.c3
-rw-r--r--eigrpd/eigrp_fsm.c2
-rw-r--r--ldpd/pfkey.c4
-rw-r--r--lib/csv.c5
-rw-r--r--lib/ferr.c4
-rw-r--r--lib/frrstr.c4
-rw-r--r--lib/grammar_sandbox.c4
-rw-r--r--lib/grammar_sandbox_main.c4
-rw-r--r--lib/hook.c4
-rw-r--r--lib/lib_errors.c4
-rw-r--r--lib/openbsd-tree.c4
-rw-r--r--lib/ptm_lib.c5
-rw-r--r--lib/strlcat.c6
-rw-r--r--lib/strlcpy.c6
-rw-r--r--nhrpd/linux.c4
-rw-r--r--nhrpd/netlink_arp.c4
-rw-r--r--nhrpd/netlink_gre.c4
-rw-r--r--nhrpd/nhrp_event.c4
-rw-r--r--nhrpd/nhrp_interface.c4
-rw-r--r--nhrpd/nhrp_main.c4
-rw-r--r--nhrpd/nhrp_packet.c4
-rw-r--r--nhrpd/nhrp_peer.c4
-rw-r--r--nhrpd/nhrp_route.c4
-rw-r--r--nhrpd/nhrp_shortcut.c4
-rw-r--r--nhrpd/resolver.c4
-rw-r--r--nhrpd/vici.c4
-rw-r--r--nhrpd/zbuf.c5
-rw-r--r--nhrpd/znl.c4
-rw-r--r--ospfd/ospf_sr.c4
-rw-r--r--pimd/mtracebis.c4
-rw-r--r--pimd/mtracebis_netlink.c4
-rw-r--r--pimd/mtracebis_routeget.c4
-rw-r--r--pimd/pim_igmp_stats.c4
-rw-r--r--qpb/qpb_allocator.c4
-rw-r--r--tests/isisd/test_fuzz_isis_tlv.c4
-rw-r--r--tests/test_lblmgr.c4
-rw-r--r--tools/permutations.c4
-rw-r--r--tools/start-stop-daemon.c5
54 files changed, 185 insertions, 25 deletions
diff --git a/babeld/babel_filter.c b/babeld/babel_filter.c
index ff5cca42a0..31778901a6 100644
--- a/babeld/babel_filter.c
+++ b/babeld/babel_filter.c
@@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "babel_filter.h"
#include "vty.h"
#include "filter.h"
diff --git a/babeld/kernel.c b/babeld/kernel.c
index ba2b58131c..d4c962af3b 100644
--- a/babeld/kernel.c
+++ b/babeld/kernel.c
@@ -21,6 +21,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <sys/time.h>
#include <sys/param.h>
#include <time.h>
diff --git a/babeld/neighbour.c b/babeld/neighbour.c
index c1592fb18a..512b60e29a 100644
--- a/babeld/neighbour.c
+++ b/babeld/neighbour.c
@@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
diff --git a/babeld/net.c b/babeld/net.c
index ad9a6bad92..d1f6a44142 100644
--- a/babeld/net.c
+++ b/babeld/net.c
@@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
diff --git a/babeld/resend.c b/babeld/resend.c
index 1f21977442..8949075f67 100644
--- a/babeld/resend.c
+++ b/babeld/resend.c
@@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <sys/time.h>
#include <time.h>
#include <string.h>
diff --git a/babeld/source.c b/babeld/source.c
index d6dd848952..75bca06206 100644
--- a/babeld/source.c
+++ b/babeld/source.c
@@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/babeld/util.c b/babeld/util.c
index 4a3ecace0c..880cda2fce 100644
--- a/babeld/util.c
+++ b/babeld/util.c
@@ -21,6 +21,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
diff --git a/bgpd/bgp_flowspec.c b/bgpd/bgp_flowspec.c
index e29508bf36..c604135bfd 100644
--- a/bgpd/bgp_flowspec.c
+++ b/bgpd/bgp_flowspec.c
@@ -18,9 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "math.h"
-
#include <zebra.h>
+#include <math.h>
+
#include "prefix.h"
#include "lib_errors.h"
diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c
index a427608f67..51504bb0ad 100644
--- a/bgpd/rfapi/rfapi.c
+++ b/bgpd/rfapi/rfapi.c
@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-#include <errno.h>
-
#include "lib/zebra.h"
#include "lib/prefix.h"
#include "lib/agg_table.h"
diff --git a/bgpd/rfapi/rfapi_ap.c b/bgpd/rfapi/rfapi_ap.c
index 691e1e4ec8..c5fda15d33 100644
--- a/bgpd/rfapi/rfapi_ap.c
+++ b/bgpd/rfapi/rfapi_ap.c
@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <errno.h>
-
#include "lib/zebra.h"
#include "lib/prefix.h"
#include "lib/agg_table.h"
diff --git a/bgpd/rfapi/rfapi_descriptor_rfp_utils.c b/bgpd/rfapi/rfapi_descriptor_rfp_utils.c
index 3217d34e77..ce5acf002c 100644
--- a/bgpd/rfapi/rfapi_descriptor_rfp_utils.c
+++ b/bgpd/rfapi/rfapi_descriptor_rfp_utils.c
@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-#include <errno.h>
-
#include "lib/zebra.h"
#include "lib/prefix.h"
#include "lib/table.h"
diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c
index 4c506da686..4601718f12 100644
--- a/bgpd/rfapi/rfapi_import.c
+++ b/bgpd/rfapi/rfapi_import.c
@@ -23,8 +23,6 @@
* Purpose: Handle import of routes from BGP to RFAPI
*/
-#include <errno.h>
-
#include "lib/zebra.h"
#include "lib/prefix.h"
#include "lib/agg_table.h"
diff --git a/bgpd/rfapi/rfapi_monitor.c b/bgpd/rfapi/rfapi_monitor.c
index 59387240fa..f18c6bfe12 100644
--- a/bgpd/rfapi/rfapi_monitor.c
+++ b/bgpd/rfapi/rfapi_monitor.c
@@ -24,8 +24,6 @@
/* TBD remove unneeded includes */
-#include <errno.h>
-
#include "lib/zebra.h"
#include "lib/prefix.h"
#include "lib/agg_table.h"
diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c
index 3ac217ff89..008da30118 100644
--- a/bgpd/rfapi/rfapi_rib.c
+++ b/bgpd/rfapi/rfapi_rib.c
@@ -23,8 +23,6 @@
* Purpose: maintain per-nve ribs and generate change lists
*/
-#include <errno.h>
-
#include "lib/zebra.h"
#include "lib/prefix.h"
#include "lib/agg_table.h"
diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c
index b2767da8b2..cd751319eb 100644
--- a/bgpd/rfapi/rfapi_vty.c
+++ b/bgpd/rfapi/rfapi_vty.c
@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-#include <errno.h>
-
#include "lib/zebra.h"
#include "lib/prefix.h"
#include "lib/agg_table.h"
diff --git a/bgpd/rfp-example/librfp/rfp_example.c b/bgpd/rfp-example/librfp/rfp_example.c
index 75e57a029e..af3092232c 100644
--- a/bgpd/rfp-example/librfp/rfp_example.c
+++ b/bgpd/rfp-example/librfp/rfp_example.c
@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
/* stub rfp */
#include "rfp_internal.h"
#include "bgpd/rfapi/rfapi.h"
diff --git a/bgpd/rfp-example/rfptest/rfptest.c b/bgpd/rfp-example/rfptest/rfptest.c
index 53e1c33cfb..48df6c0cc7 100644
--- a/bgpd/rfp-example/rfptest/rfptest.c
+++ b/bgpd/rfp-example/rfptest/rfptest.c
@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/* dummy test program */
#include <stdio.h>
diff --git a/eigrpd/eigrp_fsm.c b/eigrpd/eigrp_fsm.c
index eeefc51968..d291cab4c0 100644
--- a/eigrpd/eigrp_fsm.c
+++ b/eigrpd/eigrp_fsm.c
@@ -67,8 +67,8 @@
* 7- state not changed, usually by receiving not last reply
*/
-#include <thread.h>
#include <zebra.h>
+#include <thread.h>
#include "prefix.h"
#include "table.h"
diff --git a/ldpd/pfkey.c b/ldpd/pfkey.c
index 906737217c..a719d0cbb7 100644
--- a/ldpd/pfkey.c
+++ b/ldpd/pfkey.c
@@ -17,6 +17,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef __OpenBSD__
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/lib/csv.c b/lib/csv.c
index ce84783aa6..10e62731d1 100644
--- a/lib/csv.c
+++ b/lib/csv.c
@@ -17,6 +17,11 @@
* with this program; see the file COPYING; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/ferr.c b/lib/ferr.c
index fb5719d4de..afef196cec 100644
--- a/lib/ferr.c
+++ b/lib/ferr.c
@@ -14,6 +14,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
diff --git a/lib/frrstr.c b/lib/frrstr.c
index 715e67b868..85d968182b 100644
--- a/lib/frrstr.c
+++ b/lib/frrstr.c
@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
diff --git a/lib/grammar_sandbox.c b/lib/grammar_sandbox.c
index 51e7a3987e..ef03e85217 100644
--- a/lib/grammar_sandbox.c
+++ b/lib/grammar_sandbox.c
@@ -23,6 +23,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "command.h"
#include "memory_vty.h"
#include "graph.h"
diff --git a/lib/grammar_sandbox_main.c b/lib/grammar_sandbox_main.c
index 264c7c48f0..c9c942f9bf 100644
--- a/lib/grammar_sandbox_main.c
+++ b/lib/grammar_sandbox_main.c
@@ -23,6 +23,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "command.h"
#include "memory_vty.h"
diff --git a/lib/hook.c b/lib/hook.c
index 935064f4d2..4fe305f282 100644
--- a/lib/hook.c
+++ b/lib/hook.c
@@ -20,6 +20,10 @@
* DEALINGS IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "memory.h"
#include "hook.h"
diff --git a/lib/lib_errors.c b/lib/lib_errors.c
index 332a5b1d45..2ddc571e68 100644
--- a/lib/lib_errors.c
+++ b/lib/lib_errors.c
@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "lib_errors.h"
/* clang-format off */
diff --git a/lib/openbsd-tree.c b/lib/openbsd-tree.c
index 35bfce3a89..e8d13339b6 100644
--- a/lib/openbsd-tree.c
+++ b/lib/openbsd-tree.c
@@ -41,6 +41,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <lib/openbsd-tree.h>
diff --git a/lib/ptm_lib.c b/lib/ptm_lib.c
index 69fd61e2a0..7f868beda4 100644
--- a/lib/ptm_lib.c
+++ b/lib/ptm_lib.c
@@ -17,6 +17,11 @@
* with this program; see the file COPYING; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
diff --git a/lib/strlcat.c b/lib/strlcat.c
index be211f82a8..39773d9ac8 100644
--- a/lib/strlcat.c
+++ b/lib/strlcat.c
@@ -20,11 +20,13 @@
/* adapted for Quagga from glibc patch submission originally from
* Florian Weimer <fweimer@redhat.com>, 2016-05-18 */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdint.h>
#include <string.h>
-#include "config.h"
-
#ifndef HAVE_STRLCAT
#undef strlcat
diff --git a/lib/strlcpy.c b/lib/strlcpy.c
index b0c33ca7f4..71ee9f1a54 100644
--- a/lib/strlcpy.c
+++ b/lib/strlcpy.c
@@ -20,9 +20,11 @@
/* adapted for Quagga from glibc patch submission originally from
* Florian Weimer <fweimer@redhat.com>, 2016-05-18 */
-#include <string.h>
-
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
+
+#include <string.h>
#ifndef HAVE_STRLCPY
#undef strlcpy
diff --git a/nhrpd/linux.c b/nhrpd/linux.c
index 46a327b59f..85e941e7ba 100644
--- a/nhrpd/linux.c
+++ b/nhrpd/linux.c
@@ -7,6 +7,10 @@
* (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/nhrpd/netlink_arp.c b/nhrpd/netlink_arp.c
index af78b3d9ee..4c6827cb3d 100644
--- a/nhrpd/netlink_arp.c
+++ b/nhrpd/netlink_arp.c
@@ -7,6 +7,10 @@
* (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <fcntl.h>
#include <net/if.h>
#include <netinet/if_ether.h>
diff --git a/nhrpd/netlink_gre.c b/nhrpd/netlink_gre.c
index 75ecaa70c1..3fdfa9c313 100644
--- a/nhrpd/netlink_gre.c
+++ b/nhrpd/netlink_gre.c
@@ -7,6 +7,10 @@
* (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <sys/socket.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
diff --git a/nhrpd/nhrp_event.c b/nhrpd/nhrp_event.c
index 7ca9731765..9301c2d515 100644
--- a/nhrpd/nhrp_event.c
+++ b/nhrpd/nhrp_event.c
@@ -7,6 +7,10 @@
* (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <string.h>
#include <sys/socket.h>
#include <sys/un.h>
diff --git a/nhrpd/nhrp_interface.c b/nhrpd/nhrp_interface.c
index 3a42712748..ccca100db5 100644
--- a/nhrpd/nhrp_interface.c
+++ b/nhrpd/nhrp_interface.c
@@ -7,6 +7,10 @@
* (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <net/if_arp.h>
#include "zebra.h"
#include "linklist.h"
diff --git a/nhrpd/nhrp_main.c b/nhrpd/nhrp_main.c
index 737e70103e..f99e566399 100644
--- a/nhrpd/nhrp_main.c
+++ b/nhrpd/nhrp_main.c
@@ -7,6 +7,10 @@
* (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <unistd.h>
#include "zebra.h"
diff --git a/nhrpd/nhrp_packet.c b/nhrpd/nhrp_packet.c
index e62ee1ef72..a983aa71bc 100644
--- a/nhrpd/nhrp_packet.c
+++ b/nhrpd/nhrp_packet.c
@@ -7,6 +7,10 @@
* (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <netinet/if_ether.h>
#include "nhrpd.h"
#include "zbuf.h"
diff --git a/nhrpd/nhrp_peer.c b/nhrpd/nhrp_peer.c
index 44271d68ac..e051830f85 100644
--- a/nhrpd/nhrp_peer.c
+++ b/nhrpd/nhrp_peer.c
@@ -7,6 +7,10 @@
* (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <netinet/if_ether.h>
#include "zebra.h"
diff --git a/nhrpd/nhrp_route.c b/nhrpd/nhrp_route.c
index 044529a5ca..e7b187f3b6 100644
--- a/nhrpd/nhrp_route.c
+++ b/nhrpd/nhrp_route.c
@@ -7,6 +7,10 @@
* (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "nhrpd.h"
#include "table.h"
#include "memory.h"
diff --git a/nhrpd/nhrp_shortcut.c b/nhrpd/nhrp_shortcut.c
index 9ed2517069..84053b4b5d 100644
--- a/nhrpd/nhrp_shortcut.c
+++ b/nhrpd/nhrp_shortcut.c
@@ -7,6 +7,10 @@
* (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "nhrpd.h"
#include "table.h"
#include "memory.h"
diff --git a/nhrpd/resolver.c b/nhrpd/resolver.c
index dfa5dc3df0..f017d974df 100644
--- a/nhrpd/resolver.c
+++ b/nhrpd/resolver.c
@@ -7,6 +7,10 @@
* (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <ares.h>
#include <ares_version.h>
diff --git a/nhrpd/vici.c b/nhrpd/vici.c
index 7cd703414a..c1a99685f3 100644
--- a/nhrpd/vici.c
+++ b/nhrpd/vici.c
@@ -7,6 +7,10 @@
* (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <string.h>
#include <sys/socket.h>
#include <sys/un.h>
diff --git a/nhrpd/zbuf.c b/nhrpd/zbuf.c
index 6e7cad8aec..c662295083 100644
--- a/nhrpd/zbuf.c
+++ b/nhrpd/zbuf.c
@@ -7,7 +7,10 @@
* (at your option) any later version.
*/
-#define _GNU_SOURCE
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <string.h>
#include <unistd.h>
#include <errno.h>
diff --git a/nhrpd/znl.c b/nhrpd/znl.c
index 01b2f433af..6030987a1b 100644
--- a/nhrpd/znl.c
+++ b/nhrpd/znl.c
@@ -7,6 +7,10 @@
* (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <fcntl.h>
#include <errno.h>
#include <string.h>
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c
index 62eca156f5..220de3234d 100644
--- a/ospfd/ospf_sr.c
+++ b/ospfd/ospf_sr.c
@@ -24,6 +24,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/pimd/mtracebis.c b/pimd/mtracebis.c
index c0d95aeed9..65c495eff0 100644
--- a/pimd/mtracebis.c
+++ b/pimd/mtracebis.c
@@ -17,6 +17,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef __linux__
#include "pim_igmp_mtrace.h"
diff --git a/pimd/mtracebis_netlink.c b/pimd/mtracebis_netlink.c
index b4bf6bada3..30ee8f24ab 100644
--- a/pimd/mtracebis_netlink.c
+++ b/pimd/mtracebis_netlink.c
@@ -10,6 +10,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef __linux__
#include <stdio.h>
diff --git a/pimd/mtracebis_routeget.c b/pimd/mtracebis_routeget.c
index 8c1cd8d963..8d974403ac 100644
--- a/pimd/mtracebis_routeget.c
+++ b/pimd/mtracebis_routeget.c
@@ -17,6 +17,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef __linux__
#include <asm/types.h>
diff --git a/pimd/pim_igmp_stats.c b/pimd/pim_igmp_stats.c
index 428816e1f0..40851a4529 100644
--- a/pimd/pim_igmp_stats.c
+++ b/pimd/pim_igmp_stats.c
@@ -17,6 +17,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "pim_igmp_stats.h"
void igmp_stats_init(struct igmp_stats *stats)
diff --git a/qpb/qpb_allocator.c b/qpb/qpb_allocator.c
index 7e5ba5b0ce..aca611ba19 100644
--- a/qpb/qpb_allocator.c
+++ b/qpb/qpb_allocator.c
@@ -22,6 +22,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "linear_allocator.h"
#include "qpb_allocator.h"
diff --git a/tests/isisd/test_fuzz_isis_tlv.c b/tests/isisd/test_fuzz_isis_tlv.c
index 3a56f83f0a..b75c1002d4 100644
--- a/tests/isisd/test_fuzz_isis_tlv.c
+++ b/tests/isisd/test_fuzz_isis_tlv.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "test_fuzz_isis_tlv_tests.h"
#include <zebra.h>
diff --git a/tests/test_lblmgr.c b/tests/test_lblmgr.c
index c751c0b12d..652d7618a8 100644
--- a/tests/test_lblmgr.c
+++ b/tests/test_lblmgr.c
@@ -21,6 +21,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "lib/stream.h"
#include "lib/zclient.h"
diff --git a/tools/permutations.c b/tools/permutations.c
index 80441753e7..c5109dc3e8 100644
--- a/tools/permutations.c
+++ b/tools/permutations.c
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "command.h"
#include "graph.h"
#include "vector.h"
diff --git a/tools/start-stop-daemon.c b/tools/start-stop-daemon.c
index de58e0a20e..e1cce85557 100644
--- a/tools/start-stop-daemon.c
+++ b/tools/start-stop-daemon.c
@@ -25,12 +25,17 @@
* the whole automake/config.h dance.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef HAVE_LXC
#define _GNU_SOURCE
#include <sched.h>
#endif /* HAVE_LXC */
#include <stddef.h>
+#undef VERSION
#define VERSION "1.9.18"
#define MIN_POLL_INTERVAL 20000 /*us*/