From: Quentin Young Date: Fri, 24 Aug 2018 17:14:09 +0000 (+0000) Subject: zebra: fix includes X-Git-Tag: frr-7.1-dev~371^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F2903%2Fhead;p=mirror%2Ffrr.git zebra: fix includes Add and remove error related includes as necessary. Signed-off-by: Quentin Young --- diff --git a/zebra/if_ioctl.c b/zebra/if_ioctl.c index 8b5830fa10..6155e8c4e6 100644 --- a/zebra/if_ioctl.c +++ b/zebra/if_ioctl.c @@ -38,6 +38,7 @@ #include "zebra/interface.h" #include "zebra/rib.h" #include "zebra/rt.h" +#include "zebra/zebra_errors.h" #include diff --git a/zebra/if_ioctl_solaris.c b/zebra/if_ioctl_solaris.c index 1449925aae..6ad5909736 100644 --- a/zebra/if_ioctl_solaris.c +++ b/zebra/if_ioctl_solaris.c @@ -39,6 +39,7 @@ #include "zebra/interface.h" #include "zebra/ioctl_solaris.h" #include "zebra/rib.h" +#include "zebra/zebra_errors.h" static int if_get_addr(struct interface *, struct sockaddr *, const char *); static void interface_info_ioctl(struct interface *); diff --git a/zebra/if_sysctl.c b/zebra/if_sysctl.c index f4b552f286..df0831a9fc 100644 --- a/zebra/if_sysctl.c +++ b/zebra/if_sysctl.c @@ -37,6 +37,7 @@ #include "zebra/rt.h" #include "zebra/kernel_socket.h" #include "zebra/rib.h" +#include "zebra/zebra_errors.h" void ifstat_update_sysctl(void) { diff --git a/zebra/ioctl.c b/zebra/ioctl.c index 0469bc38c0..5c2380cdd7 100644 --- a/zebra/ioctl.c +++ b/zebra/ioctl.c @@ -33,6 +33,7 @@ #include "zebra/rib.h" #include "zebra/rt.h" #include "zebra/interface.h" +#include "zebra/zebra_errors.h" #ifndef SUNOS_5 diff --git a/zebra/ioctl_solaris.c b/zebra/ioctl_solaris.c index 74a82e7499..2f92cf256b 100644 --- a/zebra/ioctl_solaris.c +++ b/zebra/ioctl_solaris.c @@ -37,6 +37,7 @@ #include "zebra/rt.h" #include "zebra/interface.h" #include "zebra/ioctl_solaris.h" +#include "zebra/zebra_errors.h" extern struct zebra_privs_t zserv_privs; diff --git a/zebra/ipforward_proc.c b/zebra/ipforward_proc.c index 3a766b1ea9..8f44c377b3 100644 --- a/zebra/ipforward_proc.c +++ b/zebra/ipforward_proc.c @@ -25,7 +25,6 @@ #include "log.h" #include "privs.h" -#include "lib_errors.h" #include "zebra/ipforward.h" diff --git a/zebra/ipforward_solaris.c b/zebra/ipforward_solaris.c index 4a3966ca26..7f372e32f8 100644 --- a/zebra/ipforward_solaris.c +++ b/zebra/ipforward_solaris.c @@ -29,6 +29,7 @@ #include "privs.h" #include "zebra/ipforward.h" +#include "zebra/zebra_errors.h" /* ** Solaris should define IP_DEV_NAME in , but we'll save diff --git a/zebra/ipforward_sysctl.c b/zebra/ipforward_sysctl.c index e5974412d8..24ebf0a289 100644 --- a/zebra/ipforward_sysctl.c +++ b/zebra/ipforward_sysctl.c @@ -43,7 +43,7 @@ int ipforward(void) len = sizeof ipforwarding; if (sysctl(mib, MIB_SIZ, &ipforwarding, &len, 0, 0) < 0) { - flog_err_sys(LIB_ERR_SYSCALL, "Can't get ipforwarding value"); + flog_err_sys(LIB_ERR_SYSTEM_CALL, "Can't get ipforwarding value"); return -1; } return ipforwarding; @@ -57,7 +57,7 @@ int ipforward_on(void) len = sizeof ipforwarding; frr_elevate_privs(&zserv_privs) { if (sysctl(mib, MIB_SIZ, NULL, NULL, &ipforwarding, len) < 0) { - flog_err_sys(LIB_ERR_SYSCALL, + flog_err_sys(LIB_ERR_SYSTEM_CALL, "Can't set ipforwarding on"); return -1; } @@ -73,7 +73,7 @@ int ipforward_off(void) len = sizeof ipforwarding; frr_elevate_privs(&zserv_privs) { if (sysctl(mib, MIB_SIZ, NULL, NULL, &ipforwarding, len) < 0) { - flog_err_sys(LIB_ERR_SYSCALL, + flog_err_sys(LIB_ERR_SYSTEM_CALL, "Can't set ipforwarding on"); return -1; } @@ -98,7 +98,7 @@ int ipforward_ipv6(void) len = sizeof ip6forwarding; frr_elevate_privs(&zserv_privs) { if (sysctl(mib_ipv6, MIB_SIZ, &ip6forwarding, &len, 0, 0) < 0) { - flog_err_sys(_LIB_ERR_SYSCALL, + flog_err_sys(LIB_ERR_SYSTEM_CALL, "can't get ip6forwarding value"); return -1; } @@ -115,7 +115,7 @@ int ipforward_ipv6_on(void) frr_elevate_privs(&zserv_privs) { if (sysctl(mib_ipv6, MIB_SIZ, NULL, NULL, &ip6forwarding, len) < 0) { - flog_err_sys(LIB_ERR_SYSCALL, + flog_err_sys(LIB_ERR_SYSTEM_CALL, "can't get ip6forwarding value"); return -1; } @@ -132,7 +132,7 @@ int ipforward_ipv6_off(void) frr_elevate_privs(&zserv_privs) { if (sysctl(mib_ipv6, MIB_SIZ, NULL, NULL, &ip6forwarding, len) < 0) { - flog_err_sys(LIB_ERR_SYSCALL, + flog_err_sys(LIB_ERR_SYSTEM_CALL, "can't get ip6forwarding value"); return -1; } diff --git a/zebra/irdp_main.c b/zebra/irdp_main.c index b96405f9ee..fe7e58e1a9 100644 --- a/zebra/irdp_main.c +++ b/zebra/irdp_main.c @@ -59,6 +59,7 @@ #include "zebra/zserv.h" #include "zebra/redistribute.h" #include "zebra/irdp.h" +#include "zebra/zebra_errors.h" #include #include "checksum.h" diff --git a/zebra/redistribute.c b/zebra/redistribute.c index 7450dc3726..f302553554 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -43,6 +43,7 @@ #include "zebra/zapi_msg.h" #include "zebra/zebra_memory.h" #include "zebra/zebra_vxlan.h" +#include "zebra/zebra_errors.h" #define ZEBRA_PTM_SUPPORT diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 7f475fe7d7..a6b350de77 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -64,6 +64,7 @@ #include "zebra/rt_netlink.h" #include "zebra/zebra_mroute.h" #include "zebra/zebra_vxlan.h" +#include "zebra/zebra_errors.h" #ifndef AF_MPLS #define AF_MPLS 28 diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c index 1e51a48203..2ee450dd9e 100644 --- a/zebra/rt_socket.c +++ b/zebra/rt_socket.c @@ -40,6 +40,7 @@ #include "zebra/rt.h" #include "zebra/kernel_socket.h" #include "zebra/zebra_mpls.h" +#include "zebra/zebra_errors.h" extern struct zebra_privs_t zserv_privs; diff --git a/zebra/rtadv.c b/zebra/rtadv.c index 61b4caa0b7..696190492e 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -44,6 +44,7 @@ #include "zebra/zapi_msg.h" #include "zebra/zebra_ns.h" #include "zebra/zebra_vrf.h" +#include "zebra/zebra_errors.h" extern struct zebra_privs_t zserv_privs; diff --git a/zebra/rtread_getmsg.c b/zebra/rtread_getmsg.c index 1363fafec2..c82f689841 100644 --- a/zebra/rtread_getmsg.c +++ b/zebra/rtread_getmsg.c @@ -28,9 +28,11 @@ #include "if.h" #include "vrf.h" #include "vty.h" +#include "lib_errors.h" #include "zebra/rib.h" #include "zebra/rt.h" +#include "zebra/zebra_errors.h" /* Thank you, Solaris, for polluting application symbol namespace. */ #undef hook_register diff --git a/zebra/rtread_sysctl.c b/zebra/rtread_sysctl.c index ca3ff2dc65..5f6b62df23 100644 --- a/zebra/rtread_sysctl.c +++ b/zebra/rtread_sysctl.c @@ -31,6 +31,7 @@ #include "zebra/rt.h" #include "zebra/kernel_socket.h" #include "zebra/zebra_pbr.h" +#include "zebra/zebra_errors.h" /* Kernel routing table read up by sysctl function. */ void route_read(struct zebra_ns *zns) @@ -47,7 +48,7 @@ void route_read(struct zebra_ns *zns) /* Get buffer size. */ if (sysctl(mib, MIBSIZ, NULL, &bufsiz, NULL, 0) < 0) { - flog_warn(ZEBRA_ERR_ZEBRA_ERR_SYSCTL_FAILED, "sysctl fail: %s", + flog_warn(ZEBRA_ERR_SYSCTL_FAILED, "sysctl fail: %s", safe_strerror(errno)); return; } diff --git a/zebra/rule_socket.c b/zebra/rule_socket.c index 620410de04..8faca1bbc8 100644 --- a/zebra/rule_socket.c +++ b/zebra/rule_socket.c @@ -41,6 +41,7 @@ #include "zebra/kernel_netlink.h" #include "zebra/rule_netlink.h" #include "zebra/zebra_pbr.h" +#include "zebra/zebra_errors.h" enum dp_req_result kernel_add_pbr_rule(struct zebra_pbr_rule *rule) { diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index c8c3dc2e47..e4fbb73626 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -62,6 +62,7 @@ #include "zebra/zebra_pbr.h" #include "zebra/table_manager.h" #include "zebra/zapi_msg.h" +#include "zebra/zebra_errors.h" /* Encoding helpers -------------------------------------------------------- */ diff --git a/zebra/zebra_mpls_openbsd.c b/zebra/zebra_mpls_openbsd.c index 44eb64cbd4..b42cf32434 100644 --- a/zebra/zebra_mpls_openbsd.c +++ b/zebra/zebra_mpls_openbsd.c @@ -26,6 +26,7 @@ #include "zebra/rt.h" #include "zebra/zebra_mpls.h" #include "zebra/debug.h" +#include "zebra/zebra_errors.h" #include "privs.h" #include "prefix.h" diff --git a/zebra/zebra_ns.c b/zebra/zebra_ns.c index 456253cc30..aedb7c9495 100644 --- a/zebra/zebra_ns.c +++ b/zebra/zebra_ns.c @@ -26,7 +26,6 @@ #include "lib/logicalrouter.h" #include "lib/prefix.h" #include "lib/memory.h" -#include "lib/lib_errors.h" #include "rtadv.h" #include "zebra_ns.h" diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c index 5bbb8ec59d..7f9b70b0a1 100644 --- a/zebra/zebra_ptm.c +++ b/zebra/zebra_ptm.c @@ -34,6 +34,7 @@ #include "version.h" #include "vrf.h" #include "vty.h" +#include "lib_errors.h" #include "zebra/debug.h" #include "zebra/interface.h" diff --git a/zebra/zserv.c b/zebra/zserv.c index cd4872bd02..d1d6a2d3f7 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -61,6 +61,7 @@ #include "zebra/zapi_msg.h" /* for zserv_handle_commands */ #include "zebra/zebra_vrf.h" /* for zebra_vrf_lookup_by_id, zvrf */ #include "zebra/zserv.h" /* for zserv */ +#include "zebra/zebra_errors.h" /* for error messages */ /* clang-format on */ /* privileges */