summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-06-19 20:42:55 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-08-14 22:02:05 +0200
commit02705213b15f54b8601cd172e1b7123930575f86 (patch)
tree8ba4cb32a83e12ee1cfed65c914ffef1c6f2277f
parentzebra, lib: error references for zebra (diff)
downloadfrr-02705213b15f54b8601cd172e1b7123930575f86.tar.xz
frr-02705213b15f54b8601cd172e1b7123930575f86.zip
bgpd: Convert to using LIB_ERR_XXX where possible
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r--bgpd/bgp_errors.c12
-rw-r--r--bgpd/bgp_errors.h2
-rw-r--r--bgpd/bgp_flowspec.c4
-rw-r--r--bgpd/bgp_flowspec_util.c4
-rw-r--r--bgpd/bgp_fsm.c7
-rw-r--r--bgpd/bgp_network.c40
-rw-r--r--bgpd/bgp_packet.c3
-rw-r--r--bgpd/rfapi/rfapi.c7
-rw-r--r--bgpd/rfapi/rfapi_import.c8
-rw-r--r--bgpd/rfapi/vnc_export_bgp.c32
-rw-r--r--bgpd/rfapi/vnc_import_bgp.c13
-rw-r--r--bgpd/rfapi/vnc_zebra.c12
12 files changed, 80 insertions, 64 deletions
diff --git a/bgpd/bgp_errors.c b/bgpd/bgp_errors.c
index 71b19238f..d3498e44a 100644
--- a/bgpd/bgp_errors.c
+++ b/bgpd/bgp_errors.c
@@ -125,12 +125,6 @@ static struct ferr_ref ferr_bgp_err[] = {
.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",
.description = "BGP attempted to respond to open from a peer and failed",
@@ -184,12 +178,6 @@ static struct ferr_ref ferr_bgp_err[] = {
.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",
.description = "BGP attempted to attempted to apply a label but could not",
diff --git a/bgpd/bgp_errors.h b/bgpd/bgp_errors.h
index 0a829a6fb..31915cc06 100644
--- a/bgpd/bgp_errors.h
+++ b/bgpd/bgp_errors.h
@@ -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,
diff --git a/bgpd/bgp_flowspec.c b/bgpd/bgp_flowspec.c
index 2d336fa6d..b578370db 100644
--- a/bgpd/bgp_flowspec.c
+++ b/bgpd/bgp_flowspec.c
@@ -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;
}
diff --git a/bgpd/bgp_flowspec_util.c b/bgpd/bgp_flowspec_util.c
index 6408337a5..8286838db 100644
--- a/bgpd/bgp_flowspec_util.c
+++ b/bgpd/bgp_flowspec_util.c
@@ -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;
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index dc51aa981..e12bf2792 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -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,
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c
index 168e2c9b8..5b830a23a 100644
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
@@ -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);
}
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index f5964b9ab..0e02baa26 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -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;
diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c
index a1f1169a7..ae04385a5 100644
--- a/bgpd/rfapi/rfapi.c
+++ b/bgpd/rfapi/rfapi.c
@@ -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;
diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c
index c1af269d3..7bf7ff85a 100644
--- a/bgpd/rfapi/rfapi_import.c
+++ b/bgpd/rfapi/rfapi_import.c
@@ -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;
}
}
diff --git a/bgpd/rfapi/vnc_export_bgp.c b/bgpd/rfapi/vnc_export_bgp.c
index d4dd34d1d..be2ef3471 100644
--- a/bgpd/rfapi/vnc_export_bgp.c
+++ b/bgpd/rfapi/vnc_export_bgp.c
@@ -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;
}
diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c
index 156572b57..92749a3e6 100644
--- a/bgpd/rfapi/vnc_import_bgp.c
+++ b/bgpd/rfapi/vnc_import_bgp.c
@@ -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;
}
diff --git a/bgpd/rfapi/vnc_zebra.c b/bgpd/rfapi/vnc_zebra.c
index 7d564ef11..caecf2e2c 100644
--- a/bgpd/rfapi/vnc_zebra.c
+++ b/bgpd/rfapi/vnc_zebra.c
@@ -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;
}