diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-06-18 15:46:19 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-08-14 22:02:05 +0200 |
commit | 4ba03be5d32a53b439e3cd8c059c2d48eebd04eb (patch) | |
tree | 118d7d2157194895912f1ab0929be018a128ad1b /ospf6d | |
parent | lib: Cleanup some missed LIB_ERR_SYSTEM_CALL (diff) | |
download | frr-4ba03be5d32a53b439e3cd8c059c2d48eebd04eb.tar.xz frr-4ba03be5d32a53b439e3cd8c059c2d48eebd04eb.zip |
ospf6d: Update OSPFv3 to use new zlog_ferr
Update OSPFv3 to use the new zlog_ferr messages
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ospf6d')
-rw-r--r-- | ospf6d/ospf6_message.c | 6 | ||||
-rw-r--r-- | ospf6d/ospf6_network.c | 15 | ||||
-rw-r--r-- | ospf6d/ospf6_route.c | 4 | ||||
-rw-r--r-- | ospf6d/ospf6_spf.c | 4 | ||||
-rw-r--r-- | ospf6d/ospf6_zebra.c | 8 |
5 files changed, 24 insertions, 13 deletions
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index c7cd94bd3..bed2d0210 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -26,6 +26,7 @@ #include "command.h" #include "thread.h" #include "linklist.h" +#include "lib_errors.h" #include "ospf6_proto.h" #include "ospf6_lsa.h" @@ -1558,7 +1559,8 @@ int ospf6_receive(struct thread *thread) /* receive message */ len = ospf6_recvmsg(&src, &dst, &ifindex, iovector); if (len > iobuflen) { - zlog_err("Excess message read"); + zlog_ferr(LIB_ERR_DEVELOPMENT, + "Excess message read"); return 0; } @@ -1706,7 +1708,7 @@ static void ospf6_send(struct in6_addr *src, struct in6_addr *dst, /* send message */ len = ospf6_sendmsg(src, dst, &oi->interface->ifindex, iovector); if (len != ntohs(oh->length)) - zlog_err("Could not send entire message"); + zlog_ferr(LIB_ERR_DEVELOPMENT, "Could not send entire message"); } static uint32_t ospf6_packet_max(struct ospf6_interface *oi) diff --git a/ospf6d/ospf6_network.c b/ospf6d/ospf6_network.c index 4790d8f01..86481e46c 100644 --- a/ospf6d/ospf6_network.c +++ b/ospf6d/ospf6_network.c @@ -25,6 +25,7 @@ #include "sockunion.h" #include "sockopt.h" #include "privs.h" +#include "lib_errors.h" #include "libospf.h" #include "ospf6_proto.h" @@ -76,17 +77,20 @@ static void ospf6_set_checksum(void) int ospf6_serv_sock(void) { if (ospf6d_privs.change(ZPRIVS_RAISE)) - zlog_err("ospf6_serv_sock: could not raise privs"); + zlog_ferr(LIB_ERR_PRIVILEGES, + "ospf6_serv_sock: could not raise privs"); ospf6_sock = socket(AF_INET6, SOCK_RAW, IPPROTO_OSPFIGP); if (ospf6_sock < 0) { zlog_warn("Network: can't create OSPF6 socket."); if (ospf6d_privs.change(ZPRIVS_LOWER)) - zlog_err("ospf_sock_init: could not lower privs"); + zlog_ferr(LIB_ERR_PRIVILEGES, + "ospf_sock_init: could not lower privs"); return -1; } if (ospf6d_privs.change(ZPRIVS_LOWER)) - zlog_err("ospf_sock_init: could not lower privs"); + zlog_ferr(LIB_ERR_PRIVILEGES, + "ospf_sock_init: could not lower privs"); /* set socket options */ #if 1 @@ -120,8 +124,9 @@ int ospf6_sso(ifindex_t ifindex, struct in6_addr *group, int option) ret = setsockopt(ospf6_sock, IPPROTO_IPV6, option, &mreq6, sizeof(mreq6)); if (ret < 0) { - zlog_err("Network: setsockopt (%d) on ifindex %d failed: %s", - option, ifindex, safe_strerror(errno)); + zlog_ferr(LIB_ERR_SOCKET, + "Network: setsockopt (%d) on ifindex %d failed: %s", + option, ifindex, safe_strerror(errno)); return ret; } diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index 15d8eb6cf..b1ac67ae7 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -574,8 +574,8 @@ static void route_table_assert(struct ospf6_route_table *table) if (link_error == 0 && num == table->count) return; - zlog_err("PANIC !!"); - zlog_err("Something has gone wrong with ospf6_route_table[%p]", table); + zlog_ferr(LIB_ERR_DEVELOPMENT, "PANIC !!"); + zlog_ferr(LIB_ERR_DEVELOPMENT, "Something has gone wrong with ospf6_route_table[%p]", table); zlog_debug("table count = %d, real number = %d", table->count, num); zlog_debug("DUMP START"); for (r = ospf6_route_head(table); r; r = ospf6_route_next(r)) { diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c index 69c18ab75..c64f56ba3 100644 --- a/ospf6d/ospf6_spf.c +++ b/ospf6d/ospf6_spf.c @@ -30,6 +30,7 @@ #include "pqueue.h" #include "linklist.h" #include "thread.h" +#include "lib_errors.h" #include "ospf6_lsa.h" #include "ospf6_lsdb.h" @@ -272,7 +273,8 @@ static void ospf6_nexthop_calc(struct ospf6_vertex *w, struct ospf6_vertex *v, ifindex = (VERTEX_IS_TYPE(NETWORK, v) ? ospf6_spf_get_ifindex_from_nh(v) : ROUTER_LSDESC_GET_IFID(lsdesc)); if (ifindex == 0) { - zlog_err("No nexthop ifindex at vertex %s", v->name); + zlog_ferr(LIB_ERR_DEVELOPMENT, + "No nexthop ifindex at vertex %s", v->name); return; } diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index 8458d1995..8f1b009cc 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -28,6 +28,7 @@ #include "zclient.h" #include "memory.h" #include "lib/bfd.h" +#include "lib_errors.h" #include "ospf6_proto.h" #include "ospf6_top.h" @@ -362,9 +363,10 @@ static void ospf6_zebra_route_update(int type, struct ospf6_route *request) ret = zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api); if (ret < 0) - zlog_err("zclient_route_send() %s failed: %s", - (type == REM ? "delete" : "add"), - safe_strerror(errno)); + zlog_ferr(LIB_ERR_ZAPI_SOCKET, + "zclient_route_send() %s failed: %s", + (type == REM ? "delete" : "add"), + safe_strerror(errno)); return; } |