]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_zlookup.c
pimd: Convert over to use LIB_ERR_XXX for zlog_err
[mirror_frr.git] / pimd / pim_zlookup.c
index fb616e1b0dda8ea586c9993c3834516471a06c9a..12958b0390a983382f20f6b6930cd54d6b5cbc7b 100644 (file)
@@ -28,6 +28,7 @@
 #include "thread.h"
 #include "prefix.h"
 #include "vty.h"
+#include "lib_errors.h"
 
 #include "pimd.h"
 #include "pim_iface.h"
@@ -122,7 +123,8 @@ void zclient_lookup_new(void)
 {
        zlookup = zclient_new_notify(master, &zclient_options_default);
        if (!zlookup) {
-               zlog_err("%s: zclient_new() failure", __PRETTY_FUNCTION__);
+               zlog_ferr(LIB_ERR_ZAPI_SOCKET, "%s: zclient_new() failure",
+                         __PRETTY_FUNCTION__);
                return;
        }
 
@@ -168,8 +170,9 @@ static int zclient_read_nexthop(struct pim_instance *pim,
                err = zclient_read_header(s, zlookup->sock, &length, &marker,
                                          &version, &vrf_id, &command);
                if (err < 0) {
-                       zlog_err("%s: zclient_read_header() failed",
-                                __PRETTY_FUNCTION__);
+                       zlog_ferr(LIB_ERR_ZAPI_MISSMATCH,
+                                 "%s: zclient_read_header() failed",
+                                 __PRETTY_FUNCTION__);
                        zclient_lookup_failed(zlookup);
                        return -1;
                }
@@ -333,15 +336,17 @@ static int zclient_lookup_nexthop_once(struct pim_instance *pim,
 
        ret = writen(zlookup->sock, s->data, stream_get_endp(s));
        if (ret < 0) {
-               zlog_err(
+               zlog_ferr(
+                       LIB_ERR_SOCKET,
                        "%s: writen() failure: %d writing to zclient lookup socket",
                        __PRETTY_FUNCTION__, errno);
                zclient_lookup_failed(zlookup);
                return -2;
        }
        if (ret == 0) {
-               zlog_err("%s: connection closed on zclient lookup socket",
-                        __PRETTY_FUNCTION__);
+               zlog_ferr(LIB_ERR_SOCKET,
+                         "%s: connection closed on zclient lookup socket",
+                         __PRETTY_FUNCTION__);
                zclient_lookup_failed(zlookup);
                return -3;
        }
@@ -509,7 +514,8 @@ int pim_zlookup_sg_statistics(struct channel_oil *c_oil)
        count = stream_get_endp(s);
        ret = writen(zlookup->sock, s->data, count);
        if (ret <= 0) {
-               zlog_err(
+               zlog_ferr(
+                       LIB_ERR_SOCKET,
                        "%s: writen() failure: %d writing to zclient lookup socket",
                        __PRETTY_FUNCTION__, errno);
                return -1;
@@ -528,8 +534,9 @@ int pim_zlookup_sg_statistics(struct channel_oil *c_oil)
                err = zclient_read_header(s, zlookup->sock, &length, &marker,
                                          &version, &vrf_id, &command);
                if (err < 0) {
-                       zlog_err("%s: zclient_read_header() failed",
-                                __PRETTY_FUNCTION__);
+                       zlog_ferr(LIB_ERR_ZAPI_MISSMATCH,
+                                 "%s: zclient_read_header() failed",
+                                 __PRETTY_FUNCTION__);
                        zclient_lookup_failed(zlookup);
                        return -1;
                }
@@ -544,7 +551,8 @@ int pim_zlookup_sg_statistics(struct channel_oil *c_oil)
 
                        more.src = c_oil->oil.mfcc_origin;
                        more.grp = c_oil->oil.mfcc_mcastgrp;
-                       zlog_err(
+                       zlog_ferr(
+                               LIB_ERR_ZAPI_MISSMATCH,
                                "%s: Received wrong %s(%s) information requested",
                                __PRETTY_FUNCTION__, pim_str_sg_dump(&more),
                                c_oil->pim->vrf->name);