diff options
Diffstat (limited to 'pimd/pim_zlookup.c')
| -rw-r--r-- | pimd/pim_zlookup.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c index fb616e1b0d..baa07a8ec6 100644 --- a/pimd/pim_zlookup.c +++ b/pimd/pim_zlookup.c @@ -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__); + flog_err(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__); + flog_err(LIB_ERR_ZAPI_MISSMATCH, + "%s: zclient_read_header() failed", + __PRETTY_FUNCTION__); zclient_lookup_failed(zlookup); return -1; } @@ -312,14 +315,15 @@ static int zclient_lookup_nexthop_once(struct pim_instance *pim, /* Check socket. */ if (zlookup->sock < 0) { - zlog_err("%s: zclient lookup socket is not connected", - __PRETTY_FUNCTION__); + flog_err(LIB_ERR_ZAPI_SOCKET, + "%s: zclient lookup socket is not connected", + __PRETTY_FUNCTION__); zclient_lookup_failed(zlookup); return -1; } if (pim->vrf->vrf_id == VRF_UNKNOWN) { - zlog_err( + zlog_notice( "%s: VRF: %s does not fully exist yet, delaying lookup", __PRETTY_FUNCTION__, pim->vrf->name); return -1; @@ -333,15 +337,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( + flog_err( + 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__); + flog_err_sys(LIB_ERR_SOCKET, + "%s: connection closed on zclient lookup socket", + __PRETTY_FUNCTION__); zclient_lookup_failed(zlookup); return -3; } @@ -509,7 +515,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( + flog_err( + LIB_ERR_SOCKET, "%s: writen() failure: %d writing to zclient lookup socket", __PRETTY_FUNCTION__, errno); return -1; @@ -528,8 +535,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__); + flog_err(LIB_ERR_ZAPI_MISSMATCH, + "%s: zclient_read_header() failed", + __PRETTY_FUNCTION__); zclient_lookup_failed(zlookup); return -1; } @@ -544,7 +552,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( + flog_err( + LIB_ERR_ZAPI_MISSMATCH, "%s: Received wrong %s(%s) information requested", __PRETTY_FUNCTION__, pim_str_sg_dump(&more), c_oil->pim->vrf->name); |
