diff options
author | Fredi Raspall <fredi@voltanet.io> | 2018-05-01 20:43:14 +0200 |
---|---|---|
committer | Fredi Raspall <fredi@voltanet.io> | 2018-05-01 21:43:18 +0200 |
commit | 35cbe02a20ed7555cc13797568c83b933974d777 (patch) | |
tree | d96e55ef35c66183efc65d75ce5816d34b0669a3 /lib/zclient.c | |
parent | zebra: LM temporally ignore id/proto mismatch error (diff) | |
download | frr-35cbe02a20ed7555cc13797568c83b933974d777.tar.xz frr-35cbe02a20ed7555cc13797568c83b933974d777.zip |
zebra, lib: Fix SA warning and formatting.
Signed-off-by: Fredi Raspall <fredi@voltanet.io>
Diffstat (limited to 'lib/zclient.c')
-rw-r--r-- | lib/zclient.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index 8af702aaf..bf30e7a16 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -2039,7 +2039,7 @@ int lm_label_manager_connect(struct zclient *zclient) uint8_t result; if (zclient_debug) - zlog_debug("Connecting to Label Manager"); + zlog_debug("Connecting to Label Manager (LM)"); if (zclient->sock < 0) return -1; @@ -2059,20 +2059,19 @@ int lm_label_manager_connect(struct zclient *zclient) ret = writen(zclient->sock, s->data, stream_get_endp(s)); if (ret < 0) { - zlog_err("%s: can't write to zclient->sock", __func__); + zlog_err("Can't write to zclient sock"); close(zclient->sock); zclient->sock = -1; return -1; } if (ret == 0) { - zlog_err("%s: zclient->sock connection closed", __func__); + zlog_err("Zclient sock closed"); close(zclient->sock); zclient->sock = -1; return -1; } if (zclient_debug) - zlog_debug("%s: Label manager connect request (%d bytes) sent", - __func__, ret); + zlog_debug("LM connect request sent (%d bytes)", ret); /* read response */ if (zclient_read_sync_response(zclient, ZEBRA_LABEL_MANAGER_CONNECT) @@ -2087,18 +2086,17 @@ int lm_label_manager_connect(struct zclient *zclient) /* sanity */ if (proto != zclient->redist_default) - zlog_err("Wrong proto (%u) in lm_connect response. Should be %u", + zlog_err("Wrong proto (%u) in LM connect response. Should be %u", proto, zclient->redist_default); if (instance != zclient->instance) - zlog_err("Wrong instId (%u) in lm_connect response Should be %u", + zlog_err("Wrong instId (%u) in LM connect response. Should be %u", instance, zclient->instance); /* result code */ result = stream_getc(s); if (zclient_debug) zlog_debug( - "%s: Label Manager connect response received, result %u", - __func__, result); + "LM connect-response received, result %u", result); return (int)result; } @@ -2184,20 +2182,19 @@ int lm_get_label_chunk(struct zclient *zclient, uint8_t keep, ret = writen(zclient->sock, s->data, stream_get_endp(s)); if (ret < 0) { - zlog_err("%s: can't write to zclient->sock", __func__); + zlog_err("Can't write to zclient sock"); close(zclient->sock); zclient->sock = -1; return -1; } if (ret == 0) { - zlog_err("%s: zclient->sock connection closed", __func__); + zlog_err("Zclient sock closed"); close(zclient->sock); zclient->sock = -1; return -1; } if (zclient_debug) - zlog_debug("%s: Label chunk request (%d bytes) sent", __func__, - ret); + zlog_debug("Label chunk request (%d bytes) sent", ret); /* read response */ if (zclient_read_sync_response(zclient, ZEBRA_GET_LABEL_CHUNK) != 0) @@ -2227,19 +2224,18 @@ int lm_get_label_chunk(struct zclient *zclient, uint8_t keep, /* not owning this response */ if (keep != response_keep) { zlog_err( - "%s: Invalid Label chunk: %u - %u, keeps mismatch %u != %u", - __func__, *start, *end, keep, response_keep); + "Invalid Label chunk: %u - %u, keeps mismatch %u != %u", + *start, *end, keep, response_keep); } /* sanity */ if (*start > *end || *start < MPLS_LABEL_UNRESERVED_MIN || *end > MPLS_LABEL_UNRESERVED_MAX) { - zlog_err("%s: Invalid Label chunk: %u - %u", __func__, *start, - *end); + zlog_err("Invalid Label chunk: %u - %u", *start, *end); return -1; } if (zclient_debug) - zlog_debug("Label Chunk assign: %u - %u (%u) ", *start, *end, + zlog_debug("Label Chunk assign: %u - %u (%u)", *start, *end, response_keep); return 0; @@ -2260,7 +2256,7 @@ int lm_release_label_chunk(struct zclient *zclient, uint32_t start, struct stream *s; if (zclient_debug) - zlog_debug("Releasing Label Chunk"); + zlog_debug("Releasing Label Chunk %u - %u", start, end); if (zclient->sock < 0) return -1; @@ -2284,13 +2280,13 @@ int lm_release_label_chunk(struct zclient *zclient, uint32_t start, ret = writen(zclient->sock, s->data, stream_get_endp(s)); if (ret < 0) { - zlog_err("%s: can't write to zclient->sock", __func__); + zlog_err("Can't write to zclient sock"); close(zclient->sock); zclient->sock = -1; return -1; } if (ret == 0) { - zlog_err("%s: zclient->sock connection closed", __func__); + zlog_err("Zclient sock connection closed"); close(zclient->sock); zclient->sock = -1; return -1; |