]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Convert to using LIB_ERR_XXX where possible
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 19 Jun 2018 18:42:55 +0000 (14:42 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 14 Aug 2018 20:02:05 +0000 (20:02 +0000)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
12 files changed:
bgpd/bgp_errors.c
bgpd/bgp_errors.h
bgpd/bgp_flowspec.c
bgpd/bgp_flowspec_util.c
bgpd/bgp_fsm.c
bgpd/bgp_network.c
bgpd/bgp_packet.c
bgpd/rfapi/rfapi.c
bgpd/rfapi/rfapi_import.c
bgpd/rfapi/vnc_export_bgp.c
bgpd/rfapi/vnc_import_bgp.c
bgpd/rfapi/vnc_zebra.c

index 71b19238f61679b029cf32aa52c55d5cc0e46ef6..d3498e44a92ed74c4cb4edb795daa4e225015328 100644 (file)
@@ -124,12 +124,6 @@ static struct ferr_ref ferr_bgp_err[] = {
                .description = "BGP received an open from a peer that was invalid",
                .suggestion = "Determine the sending peer and correct his invalid open packet"
        },
-       {
-               .code = BGP_ERR_SOCKET,
-               .title = "Socket Error",
-               .description = "When attempting to access a socket a system error has occurred\nand we were unable to properly complete the request",
-               .suggestion = "Ensure that there are sufficient system resources available and\nensure that the frr user has sufficient permissions to work"
-       },
        {
                .code = BGP_ERR_SND_FAIL,
                .title = "BGP error sending to peer",
@@ -183,12 +177,6 @@ static struct ferr_ref ferr_bgp_err[] = {
                .description = "BGP unable to process nexthop update",
                .suggestion = "BGP received nexthop update but nexthop is not reachable in this bgp\ninstance. Report for troubleshooting"
        },
-       {
-               .code = BGP_ERR_PRIVILEGES,
-               .title = "Failure to raise or lower privileges",
-               .description = "FRR attempted to raise or lower its privileges and was unable to do so",
-               .suggestion = "Ensure that you are running FRR as the frr user and that the user has\nSufficient privileges to properly access root privileges"
-       },
        {
                .code = BGP_ERR_LABEL,
                .title = "Failure to apply label",
index 0a829a6fb7a6d32637e85479765337cf9978a670..31915cc0693db58ce085bcc462e3cae8396eeae1 100644 (file)
@@ -44,7 +44,6 @@ enum bgp_ferr_refs {
        BGP_ERR_UPDGRP_CREATE,
        BGP_ERR_UPDATE_SND,
        BGP_ERR_PKT_OPEN,
-       BGP_ERR_SOCKET,
        BGP_ERR_SND_FAIL,
        BGP_ERR_INVALID_STATUS,
        BGP_ERR_UPDATE_RCV,
@@ -54,7 +53,6 @@ enum bgp_ferr_refs {
        BGP_ERR_RFSH_RCV,
        BGP_ERR_CAP_RCV,
        BGP_ERR_NH_UPD,
-       BGP_ERR_PRIVILEGES,
        BGP_ERR_LABEL,
        BGP_ERR_MULTIPATH,
        BGP_ERR_PKT_PROCESS,
index 2d336fa6d8ceb0d9f16f3ce34c330270c2d56d38..b578370db7470749053e39a47205ecc21f7fd7e7 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <zebra.h>
 #include "prefix.h"
+#include "lib_errors.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_route.h"
@@ -102,7 +103,8 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
        safi = packet->safi;
 
        if (afi == AFI_IP6) {
-               zlog_err("BGP flowspec IPv6 not supported");
+               zlog_ferr(LIB_ERR_DEVELOPMENT,
+                         "BGP flowspec IPv6 not supported");
                return -1;
        }
 
index 6408337a5f15260eae4981d7341e9979437a3b48..8286838dbb28847f910925315c949726c7f0b090 100644 (file)
@@ -21,6 +21,7 @@
 #include "zebra.h"
 
 #include "prefix.h"
+#include "lib_errors.h"
 
 #include "bgp_table.h"
 #include "bgp_flowspec_util.h"
@@ -559,7 +560,8 @@ int bgp_flowspec_match_rules_fill(uint8_t *nlri_content, int len,
                        offset += ret;
                        break;
                default:
-                       zlog_err("%s: unknown type %d\n", __func__, type);
+                       zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: unknown type %d\n",
+                                 __func__, type);
                }
        }
        return error;
index dc51aa981d1eb63536ce479fcf55f1b179c4e6c5..e12bf279207bb92de1b9b1b76c8cd735e96ac1e4 100644 (file)
@@ -34,6 +34,7 @@
 #include "queue.h"
 #include "filter.h"
 #include "command.h"
+#include "lib_errors.h"
 
 #include "lib/json.h"
 #include "bgpd/bgpd.h"
@@ -245,7 +246,7 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
 
        if (bgp_getsockname(peer) < 0) {
                zlog_ferr(
-                       BGP_ERR_SOCKET,
+                       LIB_ERR_SOCKET,
                        "%%bgp_getsockname() failed for %s peer %s fd %d (from_peer fd %d)",
                        (CHECK_FLAG(peer->sflags, PEER_STATUS_ACCEPT_PEER)
                                 ? "accept"
@@ -258,7 +259,7 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
        if (from_peer->status > Active) {
                if (bgp_getsockname(from_peer) < 0) {
                        zlog_ferr(
-                               BGP_ERR_SOCKET,
+                               LIB_ERR_SOCKET,
                                "%%bgp_getsockname() failed for %s from_peer %s fd %d (peer fd %d)",
 
                                (CHECK_FLAG(from_peer->sflags,
@@ -1293,7 +1294,7 @@ static int bgp_connect_success(struct peer *peer)
        }
 
        if (bgp_getsockname(peer) < 0) {
-               zlog_ferr(BGP_ERR_SOCKET,
+               zlog_ferr(LIB_ERR_SOCKET,
                          "%s: bgp_getsockname(): failed for peer %s, fd %d",
                          __FUNCTION__, peer->host, peer->fd);
                bgp_notify_send(peer, BGP_NOTIFY_FSM_ERR,
index 168e2c9b8191cd55d07950a485ff7e7e44df0d81..5b830a23acd8c6c5abb659392f644f97b61f02d0 100644 (file)
@@ -98,7 +98,7 @@ static int bgp_md5_set_connect(int socket, union sockunion *su,
 
 #if HAVE_DECL_TCP_MD5SIG
        if (bgpd_privs.change(ZPRIVS_RAISE)) {
-               zlog_ferr(BGP_ERR_PRIVILEGES, "%s: could not raise privs",
+               zlog_ferr(LIB_ERR_PRIVILEGES, "%s: could not raise privs",
                          __func__);
                return ret;
        }
@@ -106,7 +106,7 @@ static int bgp_md5_set_connect(int socket, union sockunion *su,
        ret = bgp_md5_set_socket(socket, su, password);
 
        if (bgpd_privs.change(ZPRIVS_LOWER))
-               zlog_ferr(BGP_ERR_PRIVILEGES, "%s: could not lower privs",
+               zlog_ferr(LIB_ERR_PRIVILEGES, "%s: could not lower privs",
                          __func__);
 #endif /* HAVE_TCP_MD5SIG */
 
@@ -120,7 +120,7 @@ static int bgp_md5_set_password(struct peer *peer, const char *password)
        struct bgp_listener *listener;
 
        if (bgpd_privs.change(ZPRIVS_RAISE)) {
-               zlog_ferr(BGP_ERR_PRIVILEGES, "%s: could not raise privs",
+               zlog_ferr(LIB_ERR_PRIVILEGES, "%s: could not raise privs",
                          __func__);
                return -1;
        }
@@ -137,7 +137,7 @@ static int bgp_md5_set_password(struct peer *peer, const char *password)
                }
 
        if (bgpd_privs.change(ZPRIVS_LOWER))
-               zlog_ferr(BGP_ERR_PRIVILEGES, "%s: could not lower privs",
+               zlog_ferr(LIB_ERR_PRIVILEGES, "%s: could not lower privs",
                          __func__);
 
        return ret;
@@ -165,7 +165,7 @@ int bgp_set_socket_ttl(struct peer *peer, int bgp_sock)
                ret = sockopt_ttl(peer->su.sa.sa_family, bgp_sock, peer->ttl);
                if (ret) {
                        zlog_ferr(
-                               BGP_ERR_SOCKET,
+                               LIB_ERR_SOCKET,
                                "%s: Can't set TxTTL on peer (rtrid %s) socket, err = %d",
                                __func__,
                                inet_ntop(AF_INET, &peer->remote_id, buf,
@@ -181,7 +181,7 @@ int bgp_set_socket_ttl(struct peer *peer, int bgp_sock)
                ret = sockopt_ttl(peer->su.sa.sa_family, bgp_sock, MAXTTL);
                if (ret) {
                        zlog_ferr(
-                               BGP_ERR_SOCKET,
+                               LIB_ERR_SOCKET,
                                "%s: Can't set TxTTL on peer (rtrid %s) socket, err = %d",
                                __func__,
                                inet_ntop(AF_INET, &peer->remote_id, buf,
@@ -193,7 +193,7 @@ int bgp_set_socket_ttl(struct peer *peer, int bgp_sock)
                                     MAXTTL + 1 - peer->gtsm_hops);
                if (ret) {
                        zlog_ferr(
-                               BGP_ERR_SOCKET,
+                               LIB_ERR_SOCKET,
                                "%s: Can't set MinTTL on peer (rtrid %s) socket, err = %d",
                                __func__,
                                inet_ntop(AF_INET, &peer->remote_id, buf,
@@ -239,7 +239,7 @@ static int bgp_get_instance_for_inc_conn(int sock, struct bgp **bgp_inst)
        if (rc != 0) {
 #if defined(HAVE_CUMULUS)
                zlog_ferr(
-                       BGP_ERR_SOCKET,
+                       LIB_ERR_SOCKET,
                        "[Error] BGP SO_BINDTODEVICE get failed (%s), sock %d",
                        safe_strerror(errno), sock);
                return -1;
@@ -296,7 +296,7 @@ static int bgp_accept(struct thread *thread)
        /* Register accept thread. */
        accept_sock = THREAD_FD(thread);
        if (accept_sock < 0) {
-               zlog_ferr(BGP_ERR_SOCKET, "accept_sock is nevative value %d",
+               zlog_ferr(LIB_ERR_SOCKET, "accept_sock is nevative value %d",
                          accept_sock);
                return -1;
        }
@@ -308,7 +308,7 @@ static int bgp_accept(struct thread *thread)
        /* Accept client connection. */
        bgp_sock = sockunion_accept(accept_sock, &su);
        if (bgp_sock < 0) {
-               zlog_ferr(BGP_ERR_SOCKET,
+               zlog_ferr(LIB_ERR_SOCKET,
                          "[Error] BGP socket accept failed (%s)",
                          safe_strerror(errno));
                return -1;
@@ -585,14 +585,14 @@ int bgp_connect(struct peer *peer)
 
 #ifdef IPTOS_PREC_INTERNETCONTROL
        if (bgpd_privs.change(ZPRIVS_RAISE))
-               zlog_ferr(BGP_ERR_PRIVILEGES, "%s: could not raise privs",
+               zlog_ferr(LIB_ERR_PRIVILEGES, "%s: could not raise privs",
                          __func__);
        if (sockunion_family(&peer->su) == AF_INET)
                setsockopt_ipv4_tos(peer->fd, IPTOS_PREC_INTERNETCONTROL);
        else if (sockunion_family(&peer->su) == AF_INET6)
                setsockopt_ipv6_tclass(peer->fd, IPTOS_PREC_INTERNETCONTROL);
        if (bgpd_privs.change(ZPRIVS_LOWER))
-               zlog_ferr(BGP_ERR_PRIVILEGES, "%s: could not lower privs",
+               zlog_ferr(LIB_ERR_PRIVILEGES, "%s: could not lower privs",
                          __func__);
 #endif
 
@@ -662,7 +662,7 @@ static int bgp_listener(int sock, struct sockaddr *sa, socklen_t salen,
        sockopt_reuseport(sock);
 
        if (bgpd_privs.change(ZPRIVS_RAISE))
-               zlog_ferr(BGP_ERR_PRIVILEGES, "%s: could not raise privs",
+               zlog_ferr(LIB_ERR_PRIVILEGES, "%s: could not raise privs",
                          __func__);
 
 #ifdef IPTOS_PREC_INTERNETCONTROL
@@ -677,17 +677,17 @@ static int bgp_listener(int sock, struct sockaddr *sa, socklen_t salen,
        ret = bind(sock, sa, salen);
        en = errno;
        if (bgpd_privs.change(ZPRIVS_LOWER))
-               zlog_ferr(BGP_ERR_PRIVILEGES, "%s: could not lower privs",
+               zlog_ferr(LIB_ERR_PRIVILEGES, "%s: could not lower privs",
                          __func__);
 
        if (ret < 0) {
-               zlog_ferr(BGP_ERR_SOCKET, "bind: %s", safe_strerror(en));
+               zlog_ferr(LIB_ERR_SOCKET, "bind: %s", safe_strerror(en));
                return ret;
        }
 
        ret = listen(sock, SOMAXCONN);
        if (ret < 0) {
-               zlog_ferr(BGP_ERR_SOCKET, "listen: %s", safe_strerror(errno));
+               zlog_ferr(LIB_ERR_SOCKET, "listen: %s", safe_strerror(errno));
                return ret;
        }
 
@@ -730,7 +730,7 @@ int bgp_socket(struct bgp *bgp, unsigned short port, const char *address)
        if (bgpd_privs.change(ZPRIVS_LOWER))
                zlog_ferr(LIB_ERR_PRIVILEGES, "Can't lower privileges");
        if (ret != 0) {
-               zlog_ferr(BGP_ERR_SOCKET, "getaddrinfo: %s", gai_strerror(ret));
+               zlog_ferr(LIB_ERR_SOCKET, "getaddrinfo: %s", gai_strerror(ret));
                return -1;
        }
 
@@ -750,7 +750,7 @@ int bgp_socket(struct bgp *bgp, unsigned short port, const char *address)
                if (bgpd_privs.change(ZPRIVS_LOWER))
                        zlog_ferr(LIB_ERR_PRIVILEGES, "Can't lower privileges");
                if (sock < 0) {
-                       zlog_ferr(BGP_ERR_SOCKET, "socket: %s",
+                       zlog_ferr(LIB_ERR_SOCKET, "socket: %s",
                                  safe_strerror(errno));
                        continue;
                }
@@ -769,10 +769,10 @@ int bgp_socket(struct bgp *bgp, unsigned short port, const char *address)
        freeaddrinfo(ainfo_save);
        if (count == 0 && bgp->inst_type != BGP_INSTANCE_TYPE_VRF) {
                zlog_ferr(
-                       BGP_ERR_SOCKET,
+                       LIB_ERR_SOCKET,
                        "%s: no usable addresses please check other programs usage of specified port %d",
                        __func__, port);
-               zlog_ferr(BGP_ERR_SOCKET, "%s: Program cannot continue",
+               zlog_ferr(LIB_ERR_SOCKET, "%s: Program cannot continue",
                          __func__);
                exit(-1);
        }
index f5964b9abdd688f4290e22d2da775a9d6ecc673d..0e02baa2605311608365ae0fdb0eb56619385a72 100644 (file)
@@ -36,6 +36,7 @@
 #include "plist.h"
 #include "queue.h"
 #include "filter.h"
+#include "lib_errors.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_table.h"
@@ -1303,7 +1304,7 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size)
 
        /* Get sockname. */
        if ((ret = bgp_getsockname(peer)) < 0) {
-               zlog_ferr(BGP_ERR_SOCKET,
+               zlog_ferr(LIB_ERR_SOCKET,
                          "%s: bgp_getsockname() failed for peer: %s",
                          __FUNCTION__, peer->host);
                return BGP_Stop;
index a1f1169a7abf751924d06703fde838a4b95ef94f..ae04385a50f9ff64e67ecee0b6cece2d1755dc44 100644 (file)
@@ -32,6 +32,7 @@
 #include "lib/command.h"
 #include "lib/stream.h"
 #include "lib/ringbuf.h"
+#include "lib/lib_errors.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_ecommunity.h"
@@ -3933,7 +3934,8 @@ void *rfapi_rfp_init_group_config_ptr_vty(void *rfp_start_val,
                                                            size);
                break;
        default:
-               zlog_err("%s: Unknown group type=%d", __func__, type);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: Unknown group type=%d",
+                         __func__, type);
                /* should never happen */
                assert("Unknown type" == NULL);
                break;
@@ -4047,7 +4049,8 @@ void *rfapi_rfp_get_group_config_ptr_name(
                                                         criteria, search_cb);
                break;
        default:
-               zlog_err("%s: Unknown group type=%d", __func__, type);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: Unknown group type=%d",
+                         __func__, type);
                /* should never happen */
                assert("Unknown type" == NULL);
                break;
index c1af269d3fc7ee15e9c2de2f4bb1e72daac05ae4..7bf7ff85a52fc58def24d56bb194c3fe9f0818da 100644 (file)
@@ -34,6 +34,7 @@
 #include "lib/skiplist.h"
 #include "lib/thread.h"
 #include "lib/stream.h"
+#include "lib/lib_errors.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_ecommunity.h"
@@ -3028,7 +3029,7 @@ static void rfapiBgpInfoFilteredImportEncap(
                break;
 
        default:
-               zlog_err("%s: bad afi %d", __func__, afi);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad afi %d", __func__, afi);
                return;
        }
 
@@ -3485,7 +3486,7 @@ void rfapiBgpInfoFilteredImportVPN(
                break;
 
        default:
-               zlog_err("%s: bad afi %d", __func__, afi);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad afi %d", __func__, afi);
                return;
        }
 
@@ -3890,7 +3891,8 @@ rfapiBgpInfoFilteredImportFunction(safi_t safi)
 
        default:
                /* not expected */
-               zlog_err("%s: bad safi %d", __func__, safi);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad safi %d", __func__,
+                         safi);
                return rfapiBgpInfoFilteredImportBadSafi;
        }
 }
index d4dd34d1dd89dfb5dc98b11c023ff9273b346517..be2ef347198a14583bdc1295445ae7b6f0fca395 100644 (file)
@@ -33,6 +33,7 @@
 #include "lib/linklist.h"
 #include "lib/plist.h"
 #include "lib/routemap.h"
+#include "lib/lib_errors.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_ecommunity.h"
@@ -187,7 +188,8 @@ void vnc_direct_bgp_add_route_ce(struct bgp *bgp, struct route_node *rn,
 
 
        if (!afi) {
-               zlog_err("%s: can't get afi of route node", __func__);
+               zlog_ferr(LIB_ERR_DEVELOPMENT,
+                         "%s: can't get afi of route node", __func__);
                return;
        }
 
@@ -333,7 +335,7 @@ void vnc_direct_bgp_del_route_ce(struct bgp *bgp, struct route_node *rn,
        struct prefix ce_nexthop;
 
        if (!afi) {
-               zlog_err("%s: bad afi", __func__);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad afi", __func__);
                return;
        }
 
@@ -698,7 +700,8 @@ void vnc_direct_bgp_add_prefix(struct bgp *bgp,
        afi_t afi = family2afi(rn->p.family);
 
        if (!afi) {
-               zlog_err("%s: can't get afi of route node", __func__);
+               zlog_ferr(LIB_ERR_DEVELOPMENT,
+                         "%s: can't get afi of route node", __func__);
                return;
        }
 
@@ -807,7 +810,8 @@ void vnc_direct_bgp_del_prefix(struct bgp *bgp,
        afi_t afi = family2afi(rn->p.family);
 
        if (!afi) {
-               zlog_err("%s: can't get afi route node", __func__);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: can't get afi route node",
+                         __func__);
                return;
        }
 
@@ -922,7 +926,8 @@ void vnc_direct_bgp_add_nve(struct bgp *bgp, struct rfapi_descriptor *rfd)
        afi_t afi = family2afi(rfd->vn_addr.addr_family);
 
        if (!afi) {
-               zlog_err("%s: can't get afi of nve vn addr", __func__);
+               zlog_ferr(LIB_ERR_DEVELOPMENT,
+                         "%s: can't get afi of nve vn addr", __func__);
                return;
        }
 
@@ -974,7 +979,8 @@ void vnc_direct_bgp_add_nve(struct bgp *bgp, struct rfapi_descriptor *rfd)
                        if (afi == AFI_IP || afi == AFI_IP6) {
                                rt = import_table->imported_vpn[afi];
                        } else {
-                               zlog_err("%s: bad afi %d", __func__, afi);
+                               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad afi %d",
+                                         __func__, afi);
                                return;
                        }
 
@@ -1066,7 +1072,8 @@ void vnc_direct_bgp_del_nve(struct bgp *bgp, struct rfapi_descriptor *rfd)
        afi_t afi = family2afi(rfd->vn_addr.addr_family);
 
        if (!afi) {
-               zlog_err("%s: can't get afi of nve vn addr", __func__);
+               zlog_ferr(LIB_ERR_DEVELOPMENT,
+                         "%s: can't get afi of nve vn addr", __func__);
                return;
        }
 
@@ -1113,7 +1120,8 @@ void vnc_direct_bgp_del_nve(struct bgp *bgp, struct rfapi_descriptor *rfd)
                        if (afi == AFI_IP || afi == AFI_IP6) {
                                rt = import_table->imported_vpn[afi];
                        } else {
-                               zlog_err("%s: bad afi %d", __func__, afi);
+                               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad afi %d",
+                                         __func__, afi);
                                return;
                        }
 
@@ -1288,7 +1296,7 @@ static void vnc_direct_bgp_add_group_afi(struct bgp *bgp,
        if (afi == AFI_IP || afi == AFI_IP6) {
                rt = import_table->imported_vpn[afi];
        } else {
-               zlog_err("%s: bad afi %d", __func__, afi);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad afi %d", __func__, afi);
                return;
        }
 
@@ -1632,7 +1640,8 @@ void vnc_direct_bgp_rh_add_route(struct bgp *bgp, afi_t afi,
        struct attr *iattr;
 
        if (!afi) {
-               zlog_err("%s: can't get afi of route node", __func__);
+               zlog_ferr(LIB_ERR_DEVELOPMENT,
+                         "%s: can't get afi of route node", __func__);
                return;
        }
 
@@ -1751,7 +1760,8 @@ void vnc_direct_bgp_rh_del_route(struct bgp *bgp, afi_t afi,
        struct vnc_export_info *eti;
 
        if (!afi) {
-               zlog_err("%s: can't get afi route node", __func__);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: can't get afi route node",
+                         __func__);
                return;
        }
 
index 156572b57fefaf10b6c40797d5dbeeeac3c87659..92749a3e61026d54d84a278632f630ce51bb609b 100644 (file)
@@ -32,6 +32,7 @@
 #include "lib/linklist.h"
 #include "lib/plist.h"
 #include "lib/routemap.h"
+#include "lib/lib_errors.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_ecommunity.h"
@@ -602,7 +603,8 @@ static void vnc_import_bgp_add_route_mode_resolve_nve(
         */
 
        if (!afi) {
-               zlog_err("%s: can't get afi of prefix", __func__);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: can't get afi of prefix",
+                         __func__);
                return;
        }
 
@@ -718,7 +720,8 @@ static void vnc_import_bgp_add_route_mode_plain(struct bgp *bgp,
        }
 
        if (!afi) {
-               zlog_err("%s: can't get afi of prefix", __func__);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: can't get afi of prefix",
+                         __func__);
                return;
        }
 
@@ -905,7 +908,8 @@ vnc_import_bgp_add_route_mode_nvegroup(struct bgp *bgp, struct prefix *prefix,
        assert(rfg);
 
        if (!afi) {
-               zlog_err("%s: can't get afi of prefix", __func__);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: can't get afi of prefix",
+                         __func__);
                return;
        }
 
@@ -2628,7 +2632,8 @@ void vnc_import_bgp_add_route(struct bgp *bgp, struct prefix *prefix,
        VNC_RHNCK(enter);
 
        if (!afi) {
-               zlog_err("%s: can't get afi of prefix", __func__);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: can't get afi of prefix",
+                         __func__);
                return;
        }
 
index 7d564ef113dad4ee62bcb78f525b19e28a05360b..caecf2e2c6ca18011f0058e09006d2b0068f0dad 100644 (file)
@@ -32,6 +32,7 @@
 #include "lib/stream.h"
 #include "lib/ringbuf.h"
 #include "lib/memory.h"
+#include "lib/lib_errors.h"
 
 #include "bgpd/bgpd.h"
 #include "bgpd/bgp_ecommunity.h"
@@ -570,7 +571,8 @@ static void vnc_zebra_add_del_prefix(struct bgp *bgp,
                return;
 
        if (rn->p.family != AF_INET && rn->p.family != AF_INET6) {
-               zlog_err("%s: invalid route node addr family", __func__);
+               zlog_ferr(LIB_ERR_DEVELOPMENT,
+                         "%s: invalid route node addr family", __func__);
                return;
        }
 
@@ -642,7 +644,8 @@ static void vnc_zebra_add_del_nve(struct bgp *bgp, struct rfapi_descriptor *rfd,
                return;
 
        if (afi != AFI_IP && afi != AFI_IP6) {
-               zlog_err("%s: invalid vn addr family", __func__);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: invalid vn addr family",
+                         __func__);
                return;
        }
 
@@ -739,12 +742,13 @@ static void vnc_zebra_add_del_group_afi(struct bgp *bgp,
        if (afi == AFI_IP || afi == AFI_IP6) {
                rt = import_table->imported_vpn[afi];
        } else {
-               zlog_err("%s: bad afi %d", __func__, afi);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: bad afi %d", __func__, afi);
                return;
        }
 
        if (!family) {
-               zlog_err("%s: computed bad family: %d", __func__, family);
+               zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: computed bad family: %d",
+                         __func__, family);
                return;
        }