Skip to content

Commit 1f8031f

Browse files
committed
*: make sure config.h or zebra.h is first
`config.h` has all the defines from autoconf, which may include things that switch behavior of other included headers (e.g. _GNU_SOURCE enabling prototypes for additional functions.) So, the first include in any `.c` file must be either `config.h` (with the appropriate guard) or `zebra.h` (which includes `config.h` first thing.) Signed-off-by: David Lamparter <[email protected]>
1 parent b38f1fd commit 1f8031f

File tree

68 files changed

+296
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+296
-16
lines changed

bgpd/bgp_conditional_adv.c

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919
*/
2020

21+
#include <zebra.h>
22+
2123
#include "bgpd/bgp_conditional_adv.h"
2224
#include "bgpd/bgp_vty.h"
2325

bgpd/bgp_nb.c

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919
*/
2020

21+
#include <zebra.h>
22+
2123
#include "northbound.h"
2224
#include "libfrr.h"
2325
#include "bgpd/bgp_nb.h"

bgpd/bgp_nb_config.c

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919
*/
2020

21+
#include <zebra.h>
22+
2123
#include "northbound.h"
2224
#include "libfrr.h"
2325
#include "log.h"

bgpd/bgp_routemap_nb.c

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919

2020

21+
#include <zebra.h>
22+
2123
#include "lib/command.h"
2224
#include "lib/log.h"
2325
#include "lib/northbound.h"

bgpd/bgp_routemap_nb_config.c

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20+
#include <zebra.h>
21+
2022
#include "lib/command.h"
2123
#include "lib/log.h"
2224
#include "lib/northbound.h"

bgpd/bgp_trace.c

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#define TRACEPOINT_CREATE_PROBES
22
#define TRACEPOINT_DEFINE
33

4+
#include <zebra.h>
5+
46
#include "bgp_trace.h"

eigrpd/eigrp_metric.c

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2222
*/
2323

24+
#include <zebra.h>
25+
2426
#include "eigrpd/eigrp_structs.h"
2527
#include "eigrpd/eigrpd.h"
2628
#include "eigrpd/eigrp_types.h"

lib/libfrr_trace.c

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#define TRACEPOINT_CREATE_PROBES
22
#define TRACEPOINT_DEFINE
33

4+
#include <zebra.h>
5+
46
#include "libfrr_trace.h"

lib/link_state.c

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2323
*/
2424

25+
#include <zebra.h>
26+
2527
#include "if.h"
2628
#include "linklist.h"
2729
#include "log.h"

lib/routing_nb.c

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* with this program; see the file COPYING; if not, write to the Free Software
1717
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
19+
#include <zebra.h>
20+
1921
#include "northbound.h"
2022
#include "libfrr.h"
2123
#include "routing_nb.h"

lib/routing_nb_config.c

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20+
#include <zebra.h>
21+
2022
#include "northbound.h"
2123
#include "libfrr.h"
2224
#include "vrf.h"

ospf6d/ospf6_routemap_nb.c

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20+
#include <zebra.h>
21+
2022
#include "lib/northbound.h"
2123
#include "lib/routemap.h"
2224
#include "ospf6_routemap_nb.h"

ospf6d/ospf6_routemap_nb_config.c

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20+
#include <zebra.h>
21+
2022
#include "lib/command.h"
2123
#include "lib/log.h"
2224
#include "lib/northbound.h"

ospfd/ospf_routemap_nb.c

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20+
#include <zebra.h>
21+
2022
#include "lib/northbound.h"
2123
#include "lib/routemap.h"
2224
#include "ospf_routemap_nb.h"

ospfd/ospf_routemap_nb_config.c

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20+
#include <zebra.h>
21+
2022
#include "lib/command.h"
2123
#include "lib/log.h"
2224
#include "lib/northbound.h"

pathd/path_cli.c

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1717
*/
1818

19+
#include <zebra.h>
20+
1921
#include <float.h>
2022
#include <math.h>
2123
#include <zebra.h>

pathd/path_debug.c

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1717
*/
1818

19+
#include <zebra.h>
20+
1921
#include <string.h>
2022
#include <stdbool.h>
2123
#include <time.h>

pathd/path_pcep_config.c

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1717
*/
1818

19+
#include <zebra.h>
20+
1921
#include <northbound.h>
2022
#include <yang.h>
2123
#include <printfrr.h>

pathd/path_pcep_debug.c

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1717
*/
1818

19+
#include <zebra.h>
20+
1921
#include <string.h>
2022
#include <stdbool.h>
2123
#include <time.h>

pathd/path_zebra.c

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1717
*/
1818

19+
#include <zebra.h>
20+
1921
#include "thread.h"
2022
#include "log.h"
2123
#include "lib_errors.h"

pceplib/pcep_msg_messages.c

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
* This is the implementation of a High Level PCEP message API.
2626
*/
2727

28+
#ifdef HAVE_CONFIG_H
29+
#include "config.h"
30+
#endif
31+
2832
#include <string.h>
2933
#include <arpa/inet.h>
3034
#include <stdarg.h>

pceplib/pcep_msg_messages_encoding.c

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
* Encoding and decoding for PCEP messages.
2626
*/
2727

28+
#ifdef HAVE_CONFIG_H
29+
#include "config.h"
30+
#endif
31+
2832
#include <stdlib.h>
2933
#include <string.h>
3034
#include <unistd.h>

pceplib/pcep_msg_object_error_types.c

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
* Author : Brady Johnson <[email protected]>
2020
*/
2121

22+
#ifdef HAVE_CONFIG_H
23+
#include "config.h"
24+
#endif
25+
2226
#include <stdlib.h>
2327

2428
#include "pcep_msg_object_error_types.h"

pceplib/pcep_msg_objects.c

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
* This is the implementation of a High Level PCEP message object API.
2626
*/
2727

28+
#ifdef HAVE_CONFIG_H
29+
#include "config.h"
30+
#endif
31+
2832
#include <string.h>
2933
#include <arpa/inet.h>
3034
#include <stdarg.h>

pceplib/pcep_msg_objects_encoding.c

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
* Encoding and decoding for PCEP Objects.
2626
*/
2727

28+
#ifdef HAVE_CONFIG_H
29+
#include "config.h"
30+
#endif
31+
2832
#include <stdlib.h>
2933
#include <string.h>
3034

pceplib/pcep_msg_tlvs.c

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
* This is the implementation of a High Level PCEP message object TLV API.
2626
*/
2727

28+
#ifdef HAVE_CONFIG_H
29+
#include "config.h"
30+
#endif
31+
2832
#include <stdbool.h>
2933
#include <stdint.h>
3034
#include <string.h>

pceplib/pcep_msg_tools.c

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
*/
2222

2323

24+
#ifdef HAVE_CONFIG_H
25+
#include "config.h"
26+
#endif
27+
2428
#include <errno.h>
2529
#include <stdio.h>
2630
#include <string.h>

pceplib/pcep_session_logic.c

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
*/
2222

2323

24+
#ifdef HAVE_CONFIG_H
25+
#include "config.h"
26+
#endif
27+
2428
#include <errno.h>
2529
#include <limits.h>
2630
#include <pthread.h>

pceplib/pcep_session_logic_counters.c

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
* PCEP session logic counters configuration.
2626
*/
2727

28+
#ifdef HAVE_CONFIG_H
29+
#include "config.h"
30+
#endif
31+
2832
#include <stdio.h>
2933
#include <time.h>
3034

pceplib/pcep_session_logic_loop.c

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
*
2121
*/
2222

23+
#ifdef HAVE_CONFIG_H
24+
#include "config.h"
25+
#endif
26+
2327
#include <pthread.h>
2428
#include <stdbool.h>
2529
#include <stdio.h>

pceplib/pcep_session_logic_states.c

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
*
2121
*/
2222

23+
#ifdef HAVE_CONFIG_H
24+
#include "config.h"
25+
#endif
26+
2327
#include <pthread.h>
2428
#include <stdbool.h>
2529
#include <stdio.h>

pceplib/pcep_socket_comm_loop.c

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
*/
2222

2323

24+
#ifdef HAVE_CONFIG_H
25+
#include "config.h"
26+
#endif
27+
2428
#include <errno.h>
2529
#include <stdbool.h>
2630
#include <stddef.h>

pceplib/pcep_socket_comm_mock.c

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
* created.
2828
*/
2929

30+
#ifdef HAVE_CONFIG_H
31+
#include "config.h"
32+
#endif
33+
3034
#include <netinet/in.h>
3135
#include <stdbool.h>
3236
#include <stdlib.h>

pceplib/pcep_timers.c

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
* Implementation of public API timer functions.
2626
*/
2727

28+
#ifdef HAVE_CONFIG_H
29+
#include "config.h"
30+
#endif
31+
2832
#include <limits.h>
2933
#include <pthread.h>
3034
#include <stddef.h>

pceplib/pcep_timers_event_loop.c

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
*/
2222

2323

24+
#ifdef HAVE_CONFIG_H
25+
#include "config.h"
26+
#endif
27+
2428
#include <errno.h>
2529
#include <stddef.h>
2630
#include <stdbool.h>

pceplib/pcep_utils_double_linked_list.c

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
*
2121
*/
2222

23+
#ifdef HAVE_CONFIG_H
24+
#include "config.h"
25+
#endif
26+
2327
#include <stddef.h>
2428
#include <string.h>
2529

pceplib/pcep_utils_logging.c

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
*/
2222

2323

24+
#ifdef HAVE_CONFIG_H
25+
#include "config.h"
26+
#endif
27+
2428
#include <stdarg.h>
2529
#include <stdio.h>
2630
#include "pcep_utils_logging.h"

pceplib/pcep_utils_memory.c

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
*
2121
*/
2222

23+
#ifdef HAVE_CONFIG_H
24+
#include "config.h"
25+
#endif
26+
2327
#include <stdlib.h>
2428
#include <string.h>
2529

pceplib/pcep_utils_ordered_list.c

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
*/
2222

2323

24+
#ifdef HAVE_CONFIG_H
25+
#include "config.h"
26+
#endif
27+
2428
#include <stdio.h>
2529
#include <string.h>
2630

pceplib/pcep_utils_queue.c

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
*/
2222

2323

24+
#ifdef HAVE_CONFIG_H
25+
#include "config.h"
26+
#endif
27+
2428
#include <stdbool.h>
2529
#include <stdio.h>
2630
#include <string.h>

0 commit comments

Comments
 (0)