From 10387101fecf4956db38945655aa291aec63d9f7 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 4 Jan 2024 13:55:09 -0500 Subject: [PATCH 01/14] lib: Breakout sendmmsg into it's own header The only 2 places sendmmsg is used is in zlog_5424.c and zlog_live.c. Why is the rest of the entire system paying for this compilation? Signed-off-by: Donald Sharp --- lib/frrsendmmsg.h | 30 ++++++++++++++++++++++++++++++ lib/subdir.am | 1 + lib/zebra.h | 20 -------------------- lib/zlog_5424.c | 2 ++ lib/zlog_live.c | 2 ++ 5 files changed, 35 insertions(+), 20 deletions(-) create mode 100644 lib/frrsendmmsg.h diff --git a/lib/frrsendmmsg.h b/lib/frrsendmmsg.h new file mode 100644 index 000000000000..ea63d139aa3c --- /dev/null +++ b/lib/frrsendmmsg.h @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * FRR sendmmsg wrapper + * Copyright (C) 2024 by Nvidia, Inc. + * Donald Sharp + */ +#ifndef __FRRSENDMMSG_H__ +#define __FRRSENDMMSG_H__ + +#if !defined(HAVE_STRUCT_MMSGHDR_MSG_HDR) || !defined(HAVE_SENDMMSG) +/* avoid conflicts in case we have partial support */ +#define mmsghdr frr_mmsghdr +#define sendmmsg frr_sendmmsg + +struct mmsghdr { + struct msghdr msg_hdr; + unsigned int msg_len; +}; + +/* just go 1 at a time here, the loop this is used in will handle the rest */ +static inline int sendmmsg(int fd, struct mmsghdr *mmh, unsigned int len, + int flags) +{ + int rv = sendmsg(fd, &mmh->msg_hdr, 0); + + return rv > 0 ? 1 : rv; +} +#endif + +#endif diff --git a/lib/subdir.am b/lib/subdir.am index 977fd9f9aa49..4f203c0c842f 100644 --- a/lib/subdir.am +++ b/lib/subdir.am @@ -227,6 +227,7 @@ pkginclude_HEADERS += \ lib/frr_pthread.h \ lib/frratomic.h \ lib/frrcu.h \ + lib/frrsendmmsg.h \ lib/frrstr.h \ lib/graph.h \ lib/hash.h \ diff --git a/lib/zebra.h b/lib/zebra.h index e5021df22b0d..fe8ac150a7bc 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -203,26 +203,6 @@ size_t strlcpy(char *__restrict dest, void explicit_bzero(void *buf, size_t len); #endif -#if !defined(HAVE_STRUCT_MMSGHDR_MSG_HDR) || !defined(HAVE_SENDMMSG) -/* avoid conflicts in case we have partial support */ -#define mmsghdr frr_mmsghdr -#define sendmmsg frr_sendmmsg - -struct mmsghdr { - struct msghdr msg_hdr; - unsigned int msg_len; -}; - -/* just go 1 at a time here, the loop this is used in will handle the rest */ -static inline int sendmmsg(int fd, struct mmsghdr *mmh, unsigned int len, - int flags) -{ - int rv = sendmsg(fd, &mmh->msg_hdr, 0); - - return rv > 0 ? 1 : rv; -} -#endif - /* * RFC 3542 defines several macros for using struct cmsghdr. * Here, we define those that are not present diff --git a/lib/zlog_5424.c b/lib/zlog_5424.c index 3049e4a849e8..2158a713606b 100644 --- a/lib/zlog_5424.c +++ b/lib/zlog_5424.c @@ -14,6 +14,8 @@ #include "zebra.h" +#include "frrsendmmsg.h" + #include "zlog_5424.h" #include diff --git a/lib/zlog_live.c b/lib/zlog_live.c index 4d3c3508bffd..1b7696c893d0 100644 --- a/lib/zlog_live.c +++ b/lib/zlog_live.c @@ -5,6 +5,8 @@ #include "zebra.h" +#include "frrsendmmsg.h" + #include "zlog_live.h" #include "memory.h" From 2bf051a5770c22c61220c7f169432c93c0da612a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 4 Jan 2024 14:02:34 -0500 Subject: [PATCH 02/14] *: Remove Crypto openSSL define from zebra.h Only a couple of places use this. Move these to a better spot. Signed-off-by: Donald Sharp --- isisd/isis_tlvs.c | 5 +++++ lib/zebra.h | 5 ----- ospf6d/ospf6_auth_trailer.c | 6 ++++++ ospfd/ospf_auth.c | 5 +++++ ripd/ripd.c | 5 +++++ 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index ecf43faa7060..2b0a58b73986 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -13,6 +13,11 @@ #include #include +#ifdef CRYPTO_OPENSSL +#include +#include +#endif + #ifdef CRYPTO_INTERNAL #include "md5.h" #endif diff --git a/lib/zebra.h b/lib/zebra.h index fe8ac150a7bc..076f51608c73 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -83,11 +83,6 @@ #endif #endif -#ifdef CRYPTO_OPENSSL -#include -#include -#endif - #include "openbsd-tree.h" #include diff --git a/ospf6d/ospf6_auth_trailer.c b/ospf6d/ospf6_auth_trailer.c index 10e00921f1c6..82671eef77c6 100644 --- a/ospf6d/ospf6_auth_trailer.c +++ b/ospf6d/ospf6_auth_trailer.c @@ -4,6 +4,12 @@ */ #include "zebra.h" + +#ifdef CRYPTO_OPENSSL +#include +#include +#endif + #include "config.h" #include "memory.h" #include "ospf6d.h" diff --git a/ospfd/ospf_auth.c b/ospfd/ospf_auth.c index 11ee1ddb1889..74dc7d556ba4 100644 --- a/ospfd/ospf_auth.c +++ b/ospfd/ospf_auth.c @@ -6,6 +6,11 @@ #include +#ifdef CRYPTO_OPENSSL +#include +#include +#endif + #include "linklist.h" #include "if.h" #include "checksum.h" diff --git a/ripd/ripd.c b/ripd/ripd.c index a94dd96da050..d5df16c3a976 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -6,6 +6,11 @@ #include +#ifdef CRYPTO_OPENSSL +#include +#include +#endif + #include "vrf.h" #include "if.h" #include "command.h" From 78690deaf2f383bc4311519f58cc7e63eb8ce463 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 4 Jan 2024 14:04:36 -0500 Subject: [PATCH 03/14] lib: Move some priviledge headers to file they are used. Signed-off-by: Donald Sharp --- lib/privs.c | 6 ++++++ lib/zebra.h | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/privs.c b/lib/privs.c index accd9895ffec..bb1b59e43918 100644 --- a/lib/privs.c +++ b/lib/privs.c @@ -6,6 +6,12 @@ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. */ #include + +#ifdef HAVE_LCAPS +#include +#include +#endif /* HAVE_LCAPS */ + #include "log.h" #include "privs.h" #include "memory.h" diff --git a/lib/zebra.h b/lib/zebra.h index 076f51608c73..a7db00b16e5c 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -63,11 +63,6 @@ /* misc include group */ #include -#ifdef HAVE_LCAPS -#include -#include -#endif /* HAVE_LCAPS */ - /* network include group */ #include From a57379fa140ee48da521061f358b34ebc6ea7875 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 4 Jan 2024 14:18:16 -0500 Subject: [PATCH 04/14] bgpd: rfapi was not using internal zlog_backtrace() The rfapi code was not using the zlog_backtrace() functionality. Let's just convert over to using the proper functionality that we have built in now. Signed-off-by: Donald Sharp --- bgpd/rfapi/rfapi.c | 24 +----------------------- bgpd/rfapi/rfapi_import.c | 33 +-------------------------------- bgpd/rfapi/rfapi_import.h | 2 -- 3 files changed, 2 insertions(+), 57 deletions(-) diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index ff7137bdd908..a2c86d1eae9d 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -46,11 +46,6 @@ #include "bgpd/rfapi/rfapi_encap_tlv.h" #include "bgpd/rfapi/vnc_debug.h" -#ifdef HAVE_GLIBC_BACKTRACE -/* for backtrace and friends */ -#include -#endif /* HAVE_GLIBC_BACKTRACE */ - #define DEBUG_CLEANUP 0 struct ethaddr rfapi_ethaddr0 = {{0}}; @@ -2091,24 +2086,7 @@ int rfapi_close(void *handle) vnc_zlog_debug_verbose("%s: rfd=%p", __func__, rfd); #ifdef RFAPI_WHO_IS_CALLING_ME -#ifdef HAVE_GLIBC_BACKTRACE -#define RFAPI_DEBUG_BACKTRACE_NENTRIES 5 - { - void *buf[RFAPI_DEBUG_BACKTRACE_NENTRIES]; - char **syms; - int i; - size_t size; - - size = backtrace(buf, RFAPI_DEBUG_BACKTRACE_NENTRIES); - syms = backtrace_symbols(buf, size); - for (i = 0; i < size && i < RFAPI_DEBUG_BACKTRACE_NENTRIES; - ++i) { - vnc_zlog_debug_verbose("backtrace[%2d]: %s", i, - syms[i]); - } - free(syms); - } -#endif + zlog_backtrace(LOG_INFO); #endif bgp = rfd->bgp; diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index a93e186f8d82..f9789adad259 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -44,11 +44,6 @@ #include "bgpd/rfapi/rfapi_encap_tlv.h" #include "bgpd/rfapi/vnc_debug.h" -#ifdef HAVE_GLIBC_BACKTRACE -/* for backtrace and friends */ -#include -#endif /* HAVE_GLIBC_BACKTRACE */ - #undef DEBUG_MONITOR_MOVE_SHORTER #undef DEBUG_RETURNED_NHL #undef DEBUG_ROUTE_COUNTERS @@ -77,32 +72,6 @@ struct rfapi_withdraw { int lockoffset; }; -/* - * DEBUG FUNCTION - * It's evil and fiendish. It's compiler-dependent. - * ? Might need LDFLAGS -rdynamic to produce all function names - */ -void rfapiDebugBacktrace(void) -{ -#ifdef HAVE_GLIBC_BACKTRACE -#define RFAPI_DEBUG_BACKTRACE_NENTRIES 200 - void *buf[RFAPI_DEBUG_BACKTRACE_NENTRIES]; - char **syms; - size_t i; - size_t size; - - size = backtrace(buf, RFAPI_DEBUG_BACKTRACE_NENTRIES); - syms = backtrace_symbols(buf, size); - - for (i = 0; i < size && i < RFAPI_DEBUG_BACKTRACE_NENTRIES; ++i) { - vnc_zlog_debug_verbose("backtrace[%2zu]: %s", i, syms[i]); - } - - free(syms); -#else -#endif -} - /* * DEBUG FUNCTION * Count remote routes and compare with actively-maintained values. @@ -1709,7 +1678,7 @@ struct rfapi_next_hop_entry *rfapiRouteNode2NextHopList( #ifdef DEBUG_RETURNED_NHL vnc_zlog_debug_verbose("%s: called with node pfx=%rRN", __func__, rn); - rfapiDebugBacktrace(); + zlog_backtrace(LOG_INFO); #endif rfapiQprefix2Rprefix(p, &rprefix); diff --git a/bgpd/rfapi/rfapi_import.h b/bgpd/rfapi/rfapi_import.h index dd06afe7e26a..1a37e1c2dbfe 100644 --- a/bgpd/rfapi/rfapi_import.h +++ b/bgpd/rfapi/rfapi_import.h @@ -57,8 +57,6 @@ struct rfapi_import_table { extern uint8_t rfapiRfpCost(struct attr *attr); -extern void rfapiDebugBacktrace(void); - extern void rfapiCheckRouteCount(void); /* From fbc31156f0ae2d1a345994e2de95166e28fa70ac Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 4 Jan 2024 14:20:40 -0500 Subject: [PATCH 05/14] lib: HAVE_GLIBC_BACKTRACE does not belong in zebra.h The backtrace functionality has been abstracted over to zlog_backtrace(). Now that every place uses this move the inclusion for HAVE_GLIBC_BACKTRACE into the appropriate files instead of having everyone pay for this costly include. Signed-off-by: Donald Sharp --- lib/log.c | 4 ++++ lib/zebra.h | 4 ---- lib/zlog.c | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/log.c b/lib/log.c index a92f9e8855e1..b18b37efa3f5 100644 --- a/lib/log.c +++ b/lib/log.c @@ -8,6 +8,10 @@ #include +#ifdef HAVE_GLIBC_BACKTRACE +#include +#endif /* HAVE_GLIBC_BACKTRACE */ + #include "zclient.h" #include "log.h" #include "memory.h" diff --git a/lib/zebra.h b/lib/zebra.h index a7db00b16e5c..f838990b30a4 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -156,10 +156,6 @@ #define UINT32_MAX (4294967295U) #endif -#ifdef HAVE_GLIBC_BACKTRACE -#include -#endif /* HAVE_GLIBC_BACKTRACE */ - /* Local includes: */ #if !defined(__GNUC__) #define __attribute__(x) diff --git a/lib/zlog.c b/lib/zlog.c index 2a6189573fe7..446bdd7021fd 100644 --- a/lib/zlog.c +++ b/lib/zlog.c @@ -5,6 +5,10 @@ #include "zebra.h" +#ifdef HAVE_GLIBC_BACKTRACE +#include +#endif /* HAVE_GLIBC_BACKTRACE */ + #include #include #include From ca5454057678927d5e4b244ab49fedc448198f0c Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 4 Jan 2024 14:24:01 -0500 Subject: [PATCH 06/14] lib: Remove inclusion of various MAXINT from zebra.h All modern systems should have these defined. Let's stop paying the cost of this compilation. Signed-off-by: Donald Sharp --- lib/zebra.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/zebra.h b/lib/zebra.h index f838990b30a4..362037bf54c6 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -140,22 +140,6 @@ #include #endif /* HAVE_NETINET6_ND6_H */ -/* Some systems do not define UINT32_MAX, etc.. from inttypes.h - * e.g. this makes life easier for FBSD 4.11 users. - */ -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - /* Local includes: */ #if !defined(__GNUC__) #define __attribute__(x) From 75b3e82dfa88d85782d0b08fe80e2e4e15abfb6b Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 4 Jan 2024 14:26:33 -0500 Subject: [PATCH 07/14] *: Remove cost of including netinet/icmp.h everywhere This file inclusion is only used in 3 places move the includes to those spots. Signed-off-by: Donald Sharp --- lib/zebra.h | 2 -- pimd/pim6_mld.c | 1 + pimd/pim_mroute.c | 2 ++ zebra/rtadv.c | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/zebra.h b/lib/zebra.h index 362037bf54c6..39f5ae9bf675 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -134,8 +134,6 @@ #include #endif /* HAVE_NETINET6_IP6_H */ -#include - #ifdef HAVE_NETINET6_ND6_H #include #endif /* HAVE_NETINET6_ND6_H */ diff --git a/pimd/pim6_mld.c b/pimd/pim6_mld.c index 20ef9216a9c9..a39d182990bf 100644 --- a/pimd/pim6_mld.c +++ b/pimd/pim6_mld.c @@ -13,6 +13,7 @@ */ #include +#include #include #include "lib/memory.h" diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index 7ea6ed9e1407..e1b861b45b22 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -5,6 +5,8 @@ */ #include +#include + #include "log.h" #include "privs.h" #include "if.h" diff --git a/zebra/rtadv.c b/zebra/rtadv.c index df444ee52325..00f018d19232 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -6,6 +6,7 @@ */ #include +#include #include "memory.h" #include "sockopt.h" From 1b1fc14ffc65bff7ef7ee4c9da45f534f15e7a00 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 4 Jan 2024 14:32:32 -0500 Subject: [PATCH 08/14] lib: Remove in_systm.h it is never used Signed-off-by: Donald Sharp --- lib/zebra.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/zebra.h b/lib/zebra.h index 39f5ae9bf675..ec486c0ddee3 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -81,7 +81,6 @@ #include "openbsd-tree.h" #include -#include #include #include From 88f8c900738d0df6332fae65f2415756e29f9b24 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 4 Jan 2024 14:34:14 -0500 Subject: [PATCH 09/14] lib, vtysh: Remove inclusion of grp.h for everyone Signed-off-by: Donald Sharp --- lib/privs.c | 2 ++ lib/zebra.h | 1 - vtysh/vtysh.c | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/privs.c b/lib/privs.c index bb1b59e43918..ef4a0adf044a 100644 --- a/lib/privs.c +++ b/lib/privs.c @@ -7,6 +7,8 @@ */ #include +#include + #ifdef HAVE_LCAPS #include #include diff --git a/lib/zebra.h b/lib/zebra.h index ec486c0ddee3..f7b7a63a44a7 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -22,7 +22,6 @@ #include #include #include -#include #ifdef HAVE_STROPTS_H #include #endif /* HAVE_STROPTS_H */ diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 29358336e838..37653c624265 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -5,6 +5,8 @@ #include +#include + #include #include #include From 2700519cb3ef9f85b7395a7c781fd5fa48a5570a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 4 Jan 2024 14:42:17 -0500 Subject: [PATCH 10/14] *: Remove sys/ioctl.h from zebra.h Practically no-one uses this and ioctls are pretty much wrappered. Further wrappering could make this even better. Signed-off-by: Donald Sharp --- bfdd/bfd_packet.c | 1 + lib/pullwr.c | 2 ++ lib/vrf.c | 1 + lib/zebra.h | 1 - nhrpd/linux.c | 1 + pimd/pim_cmd_common.c | 1 + pimd/pim_mroute.c | 1 + zebra/if_ioctl.c | 1 + zebra/ioctl.c | 2 ++ zebra/zebra_mpls_openbsd.c | 1 + 10 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bfdd/bfd_packet.c b/bfdd/bfd_packet.c index f2596dfc3c50..fec195c77eb6 100644 --- a/bfdd/bfd_packet.c +++ b/bfdd/bfd_packet.c @@ -12,6 +12,7 @@ */ #include +#include #ifdef GNU_LINUX #include diff --git a/lib/pullwr.c b/lib/pullwr.c index 3967eb587541..919a663db536 100644 --- a/lib/pullwr.c +++ b/lib/pullwr.c @@ -6,6 +6,8 @@ #include "zebra.h" +#include + #include "pullwr.h" #include "memory.h" #include "monotime.h" diff --git a/lib/vrf.c b/lib/vrf.c index 5537f71254d6..48071f2bd66d 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -5,6 +5,7 @@ */ #include +#include #include "if.h" #include "vrf.h" diff --git a/lib/zebra.h b/lib/zebra.h index f7b7a63a44a7..e68cb332030e 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -36,7 +36,6 @@ #include #endif #endif /* HAVE_SYS_SYSCTL_H */ -#include #ifdef HAVE_SYS_CONF_H #include #endif /* HAVE_SYS_CONF_H */ diff --git a/nhrpd/linux.c b/nhrpd/linux.c index eb98166872c6..2a255c435cea 100644 --- a/nhrpd/linux.c +++ b/nhrpd/linux.c @@ -7,6 +7,7 @@ #include #include +#include #include "nhrp_protocol.h" #include "os.h" diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c index 1ea79a10ed90..59addd48c0b8 100644 --- a/pimd/pim_cmd_common.c +++ b/pimd/pim_cmd_common.c @@ -6,6 +6,7 @@ */ #include +#include #include "lib/json.h" #include "command.h" diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index e1b861b45b22..e00888acf384 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -6,6 +6,7 @@ #include #include +#include #include "log.h" #include "privs.h" diff --git a/zebra/if_ioctl.c b/zebra/if_ioctl.c index b3cf86512258..d0aa2167fe5d 100644 --- a/zebra/if_ioctl.c +++ b/zebra/if_ioctl.c @@ -5,6 +5,7 @@ */ #include +#include #ifdef OPEN_BSD diff --git a/zebra/ioctl.c b/zebra/ioctl.c index 8da1ae37c69f..a35784cd36e4 100644 --- a/zebra/ioctl.c +++ b/zebra/ioctl.c @@ -6,6 +6,8 @@ #include +#include + #include "linklist.h" #include "if.h" #include "prefix.h" diff --git a/zebra/zebra_mpls_openbsd.c b/zebra/zebra_mpls_openbsd.c index a696275a9810..2a3ccc806517 100644 --- a/zebra/zebra_mpls_openbsd.c +++ b/zebra/zebra_mpls_openbsd.c @@ -4,6 +4,7 @@ */ #include +#include #ifdef OPEN_BSD From d69ac58c657cd4a37281b0c57918a68c85508fcd Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 4 Jan 2024 14:43:46 -0500 Subject: [PATCH 11/14] lib, sharpd: Move sys/resource.h to where it is used Signed-off-by: Donald Sharp --- lib/zebra.h | 1 - sharpd/sharp_logpump.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zebra.h b/lib/zebra.h index e68cb332030e..8de71d01770a 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include diff --git a/sharpd/sharp_logpump.c b/sharpd/sharp_logpump.c index 5474e80b116a..d02921f28724 100644 --- a/sharpd/sharp_logpump.c +++ b/sharpd/sharp_logpump.c @@ -5,6 +5,7 @@ */ #include +#include #include "vty.h" #include "command.h" From 0b4ff790636b6c9fe15e861249a4ca59c4a3bd12 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 4 Jan 2024 14:50:23 -0500 Subject: [PATCH 12/14] *: sys/uio.h does not need to be in zebra.h Signed-off-by: Donald Sharp --- lib/imsg-buffer.c | 1 + lib/zebra.h | 1 - zebra/zebra_mpls_openbsd.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/imsg-buffer.c b/lib/imsg-buffer.c index 4f041ff66ef0..556e0cf90490 100644 --- a/lib/imsg-buffer.c +++ b/lib/imsg-buffer.c @@ -6,6 +6,7 @@ */ #include +#include #include "queue.h" #include "imsg.h" diff --git a/lib/zebra.h b/lib/zebra.h index 8de71d01770a..889e68a85c83 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include diff --git a/zebra/zebra_mpls_openbsd.c b/zebra/zebra_mpls_openbsd.c index 2a3ccc806517..9cbe6a2e7030 100644 --- a/zebra/zebra_mpls_openbsd.c +++ b/zebra/zebra_mpls_openbsd.c @@ -5,6 +5,7 @@ #include #include +#include #ifdef OPEN_BSD From cbc187867ce92be3a04320933cccc12ac22c1deb Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 4 Jan 2024 14:52:12 -0500 Subject: [PATCH 13/14] lib: zebra.h does not need to include syslog.h Signed-off-by: Donald Sharp --- lib/zebra.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/zebra.h b/lib/zebra.h index 889e68a85c83..68e326d0afc9 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -42,7 +42,6 @@ #ifdef HAVE_SYS_KSYM_H #include #endif /* HAVE_SYS_KSYM_H */ -#include #include #include #include From 496d87c14f59345ecf851084e9c6a1ebe2a5ae60 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 4 Jan 2024 14:53:10 -0500 Subject: [PATCH 14/14] lib: sys/utsname.h is not needed in zebra.h Signed-off-by: Donald Sharp --- lib/command.c | 1 + lib/zebra.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/command.c b/lib/command.c index 86da488fdf55..b33998839b28 100644 --- a/lib/command.c +++ b/lib/command.c @@ -10,6 +10,7 @@ */ #include +#include #include #include "command.h" diff --git a/lib/zebra.h b/lib/zebra.h index 68e326d0afc9..06be33f5dd54 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -44,7 +44,6 @@ #endif /* HAVE_SYS_KSYM_H */ #include #include -#include #include #include #include