summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-09-13 21:38:57 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-09-13 21:38:57 +0200
commit1c50c1c0d683ebfa53c1607c71b8d26547e8f218 (patch)
tree0dbb03af253cdcb0abeacaf6a860a4c7600359c5 /lib
parent*: LIB_[ERR|WARN] -> EC_LIB (diff)
downloadfrr-1c50c1c0d683ebfa53c1607c71b8d26547e8f218.tar.xz
frr-1c50c1c0d683ebfa53c1607c71b8d26547e8f218.zip
*: style for EC replacements
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/agentx.c12
-rw-r--r--lib/frr_zmq.c4
-rw-r--r--lib/if.h36
-rw-r--r--lib/libfrr.c14
-rw-r--r--lib/log.c7
-rw-r--r--lib/netns_linux.c8
-rw-r--r--lib/prefix.c4
-rw-r--r--lib/skiplist.c2
-rw-r--r--lib/sockopt.c6
-rw-r--r--lib/sockunion.c3
-rw-r--r--lib/stream.c8
-rw-r--r--lib/vrf.c4
-rw-r--r--lib/vty.c13
-rw-r--r--lib/zclient.c96
14 files changed, 104 insertions, 113 deletions
diff --git a/lib/agentx.c b/lib/agentx.c
index 9fb9138c6..55bb9e99e 100644
--- a/lib/agentx.c
+++ b/lib/agentx.c
@@ -142,20 +142,16 @@ static int agentx_log_callback(int major, int minor, void *serverarg,
msg[strlen(msg) - 1] = '\0';
switch (slm->priority) {
case LOG_EMERG:
- flog_err(EC_LIB_SNMP,
- "snmp[emerg]: %s", msg ? msg : slm->msg);
+ flog_err(EC_LIB_SNMP, "snmp[emerg]: %s", msg ? msg : slm->msg);
break;
case LOG_ALERT:
- flog_err(EC_LIB_SNMP,
- "snmp[alert]: %s", msg ? msg : slm->msg);
+ flog_err(EC_LIB_SNMP, "snmp[alert]: %s", msg ? msg : slm->msg);
break;
case LOG_CRIT:
- flog_err(EC_LIB_SNMP,
- "snmp[crit]: %s", msg ? msg : slm->msg);
+ flog_err(EC_LIB_SNMP, "snmp[crit]: %s", msg ? msg : slm->msg);
break;
case LOG_ERR:
- flog_err(EC_LIB_SNMP,
- "snmp[err]: %s", msg ? msg : slm->msg);
+ flog_err(EC_LIB_SNMP, "snmp[err]: %s", msg ? msg : slm->msg);
break;
case LOG_WARNING:
flog_warn(EC_LIB_SNMP, "snmp[warning]: %s",
diff --git a/lib/frr_zmq.c b/lib/frr_zmq.c
index ef85504a7..cfea238d9 100644
--- a/lib/frr_zmq.c
+++ b/lib/frr_zmq.c
@@ -142,7 +142,7 @@ static int frrzmq_read_msg(struct thread *t)
out_err:
flog_err(EC_LIB_ZMQ, "ZeroMQ read error: %s(%d)", strerror(errno),
- errno);
+ errno);
if (cb->read.cb_error)
cb->read.cb_error(cb->read.arg, cb->zmqsock);
return 1;
@@ -256,7 +256,7 @@ static int frrzmq_write_msg(struct thread *t)
out_err:
flog_err(EC_LIB_ZMQ, "ZeroMQ write error: %s(%d)", strerror(errno),
- errno);
+ errno);
if (cb->write.cb_error)
cb->write.cb_error(cb->write.arg, cb->zmqsock);
return 1;
diff --git a/lib/if.h b/lib/if.h
index 22deffb34..f9c2f7e0b 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -297,35 +297,31 @@ DECLARE_QOBJ_TYPE(interface)
#define IFNAME_RB_INSERT(vrf, ifp) \
if (RB_INSERT(if_name_head, &vrf->ifaces_by_name, (ifp))) \
- flog_err( \
- EC_LIB_INTERFACE, \
- "%s(%s): corruption detected -- interface with this " \
- "name exists already in VRF %u!", \
- __func__, (ifp)->name, (ifp)->vrf_id);
+ flog_err(EC_LIB_INTERFACE, \
+ "%s(%s): corruption detected -- interface with this " \
+ "name exists already in VRF %u!", \
+ __func__, (ifp)->name, (ifp)->vrf_id);
#define IFNAME_RB_REMOVE(vrf, ifp) \
if (RB_REMOVE(if_name_head, &vrf->ifaces_by_name, (ifp)) == NULL) \
- flog_err( \
- EC_LIB_INTERFACE, \
- "%s(%s): corruption detected -- interface with this " \
- "name doesn't exist in VRF %u!", \
- __func__, (ifp)->name, (ifp)->vrf_id);
+ flog_err(EC_LIB_INTERFACE, \
+ "%s(%s): corruption detected -- interface with this " \
+ "name doesn't exist in VRF %u!", \
+ __func__, (ifp)->name, (ifp)->vrf_id);
#define IFINDEX_RB_INSERT(vrf, ifp) \
if (RB_INSERT(if_index_head, &vrf->ifaces_by_index, (ifp))) \
- flog_err( \
- EC_LIB_INTERFACE, \
- "%s(%u): corruption detected -- interface with this " \
- "ifindex exists already in VRF %u!", \
- __func__, (ifp)->ifindex, (ifp)->vrf_id);
+ flog_err(EC_LIB_INTERFACE, \
+ "%s(%u): corruption detected -- interface with this " \
+ "ifindex exists already in VRF %u!", \
+ __func__, (ifp)->ifindex, (ifp)->vrf_id);
#define IFINDEX_RB_REMOVE(vrf, ifp) \
if (RB_REMOVE(if_index_head, &vrf->ifaces_by_index, (ifp)) == NULL) \
- flog_err( \
- EC_LIB_INTERFACE, \
- "%s(%u): corruption detected -- interface with this " \
- "ifindex doesn't exist in VRF %u!", \
- __func__, (ifp)->ifindex, (ifp)->vrf_id);
+ flog_err(EC_LIB_INTERFACE, \
+ "%s(%u): corruption detected -- interface with this " \
+ "ifindex doesn't exist in VRF %u!", \
+ __func__, (ifp)->ifindex, (ifp)->vrf_id);
#define FOR_ALL_INTERFACES(vrf, ifp) \
if (vrf) \
diff --git a/lib/libfrr.c b/lib/libfrr.c
index 2ec9f66fe..69e688261 100644
--- a/lib/libfrr.c
+++ b/lib/libfrr.c
@@ -274,12 +274,14 @@ static void frr_guard_daemon(void)
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
if (fcntl(fd, F_GETLK, &lock) < 0) {
- flog_err_sys(EC_LIB_SYSTEM_CALL,
+ flog_err_sys(
+ EC_LIB_SYSTEM_CALL,
"Could not do F_GETLK pid_file %s (%s), exiting",
path, safe_strerror(errno));
exit(1);
} else if (lock.l_type == F_WRLCK) {
- flog_err_sys(EC_LIB_SYSTEM_CALL,
+ flog_err_sys(
+ EC_LIB_SYSTEM_CALL,
"Process %d has a write lock on file %s already! Error: (%s)",
lock.l_pid, path, safe_strerror(errno));
exit(1);
@@ -543,15 +545,15 @@ static void frr_mkdir(const char *path, bool strip)
if (errno == EEXIST)
return;
- flog_err(EC_LIB_SYSTEM_CALL, "failed to mkdir \"%s\": %s",
- path, strerror(errno));
+ flog_err(EC_LIB_SYSTEM_CALL, "failed to mkdir \"%s\": %s", path,
+ strerror(errno));
return;
}
zprivs_get_ids(&ids);
if (chown(path, ids.uid_normal, ids.gid_normal))
- flog_err(EC_LIB_SYSTEM_CALL, "failed to chown \"%s\": %s",
- path, strerror(errno));
+ flog_err(EC_LIB_SYSTEM_CALL, "failed to chown \"%s\": %s", path,
+ strerror(errno));
}
static struct thread_master *master;
diff --git a/lib/log.c b/lib/log.c
index c45c26cb7..52ea8d900 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -990,7 +990,7 @@ static const struct zebra_desc_table *zroute_lookup(unsigned int zroute)
if (zroute >= array_size(route_types)) {
flog_err(EC_LIB_DEVELOPMENT, "unknown zebra route type: %u",
- zroute);
+ zroute);
return &unknown;
}
if (zroute == route_types[zroute].type)
@@ -1005,8 +1005,7 @@ static const struct zebra_desc_table *zroute_lookup(unsigned int zroute)
}
}
flog_err(EC_LIB_DEVELOPMENT,
- "internal error: cannot find route type %u in table!",
- zroute);
+ "internal error: cannot find route type %u in table!", zroute);
return &unknown;
}
@@ -1024,7 +1023,7 @@ const char *zserv_command_string(unsigned int command)
{
if (command >= array_size(command_types)) {
flog_err(EC_LIB_DEVELOPMENT, "unknown zserv command type: %u",
- command);
+ command);
return unknown.string;
}
return command_types[command].string;
diff --git a/lib/netns_linux.c b/lib/netns_linux.c
index d113426be..ef2f5dc95 100644
--- a/lib/netns_linux.c
+++ b/lib/netns_linux.c
@@ -228,8 +228,8 @@ static int ns_enable_internal(struct ns *ns, void (*func)(ns_id_t, void *))
/* Non default NS. leave */
if (ns->ns_id == NS_UNKNOWN) {
flog_err(EC_LIB_NS,
- "Can not enable NS %s %u: Invalid NSID",
- ns->name, ns->ns_id);
+ "Can not enable NS %s %u: Invalid NSID",
+ ns->name, ns->ns_id);
return 0;
}
if (func)
@@ -488,7 +488,7 @@ void ns_init_management(ns_id_t default_ns_id, ns_id_t internal_ns)
default_ns = ns_get_created_internal(NULL, NULL, default_ns_id);
if (!default_ns) {
flog_err(EC_LIB_NS, "%s: failed to create the default NS!",
- __func__);
+ __func__);
exit(1);
}
if (have_netns()) {
@@ -506,7 +506,7 @@ void ns_init_management(ns_id_t default_ns_id, ns_id_t internal_ns)
/* Enable the default NS. */
if (!ns_enable(default_ns, NULL)) {
flog_err(EC_LIB_NS, "%s: failed to enable the default NS!",
- __func__);
+ __func__);
exit(1);
}
}
diff --git a/lib/prefix.c b/lib/prefix.c
index f5d40d8c0..21c3af7d4 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -658,8 +658,8 @@ void prefix_copy(struct prefix *dest, const struct prefix *src)
(void *)src->u.prefix_flowspec.ptr, len);
} else {
flog_err(EC_LIB_DEVELOPMENT,
- "prefix_copy(): Unknown address family %d",
- src->family);
+ "prefix_copy(): Unknown address family %d",
+ src->family);
assert(0);
}
}
diff --git a/lib/skiplist.c b/lib/skiplist.c
index baef7a381..3933429c3 100644
--- a/lib/skiplist.c
+++ b/lib/skiplist.c
@@ -184,7 +184,7 @@ int skiplist_insert(register struct skiplist *l, register void *key,
/* DEBUG */
if (!key) {
flog_err(EC_LIB_DEVELOPMENT, "%s: key is 0, value is %p",
- __func__, value);
+ __func__, value);
}
p = l->header;
diff --git a/lib/sockopt.c b/lib/sockopt.c
index e878ae1dd..ea04f2a43 100644
--- a/lib/sockopt.c
+++ b/lib/sockopt.c
@@ -129,8 +129,7 @@ int setsockopt_ipv6_multicast_hops(int sock, int val)
ret = setsockopt(sock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &val,
sizeof(val));
if (ret < 0)
- flog_err(EC_LIB_SOCKET,
- "can't setsockopt IPV6_MULTICAST_HOPS");
+ flog_err(EC_LIB_SOCKET, "can't setsockopt IPV6_MULTICAST_HOPS");
return ret;
}
@@ -171,8 +170,7 @@ int setsockopt_ipv6_multicast_loop(int sock, int val)
ret = setsockopt(sock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &val,
sizeof(val));
if (ret < 0)
- flog_err(EC_LIB_SOCKET,
- "can't setsockopt IPV6_MULTICAST_LOOP");
+ flog_err(EC_LIB_SOCKET, "can't setsockopt IPV6_MULTICAST_LOOP");
return ret;
}
diff --git a/lib/sockunion.c b/lib/sockunion.c
index d76c407f5..bee82a067 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -576,8 +576,7 @@ union sockunion *sockunion_getpeername(int fd)
len = sizeof name;
ret = getpeername(fd, (struct sockaddr *)&name, &len);
if (ret < 0) {
- flog_err(EC_LIB_SOCKET,
- "Can't get remote address and port: %s",
+ flog_err(EC_LIB_SOCKET, "Can't get remote address and port: %s",
safe_strerror(errno));
return NULL;
}
diff --git a/lib/stream.c b/lib/stream.c
index 21c02a5f5..6c187bd35 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -54,7 +54,7 @@ DEFINE_MTYPE_STATIC(LIB, STREAM_FIFO, "Stream FIFO")
* using stream_put..._at() functions.
*/
#define STREAM_WARN_OFFSETS(S) \
- flog_warn(EC_LIB_STREAM, \
+ flog_warn(EC_LIB_STREAM, \
"&(struct stream): %p, size: %lu, getp: %lu, endp: %lu\n", \
(void *)(S), (unsigned long)(S)->size, \
(unsigned long)(S)->getp, (unsigned long)(S)->endp)
@@ -69,7 +69,7 @@ DEFINE_MTYPE_STATIC(LIB, STREAM_FIFO, "Stream FIFO")
#define STREAM_BOUND_WARN(S, WHAT) \
do { \
- flog_warn(EC_LIB_STREAM, "%s: Attempt to %s out of bounds", \
+ flog_warn(EC_LIB_STREAM, "%s: Attempt to %s out of bounds", \
__func__, (WHAT)); \
STREAM_WARN_OFFSETS(S); \
assert(0); \
@@ -77,7 +77,7 @@ DEFINE_MTYPE_STATIC(LIB, STREAM_FIFO, "Stream FIFO")
#define STREAM_BOUND_WARN2(S, WHAT) \
do { \
- flog_warn(EC_LIB_STREAM, "%s: Attempt to %s out of bounds", \
+ flog_warn(EC_LIB_STREAM, "%s: Attempt to %s out of bounds", \
__func__, (WHAT)); \
STREAM_WARN_OFFSETS(S); \
} while (0)
@@ -87,7 +87,7 @@ DEFINE_MTYPE_STATIC(LIB, STREAM_FIFO, "Stream FIFO")
do { \
if (((S)->endp + (Z)) > (S)->size) { \
flog_warn( \
- EC_LIB_STREAM, \
+ EC_LIB_STREAM, \
"CHECK_SIZE: truncating requested size %lu\n", \
(unsigned long)(Z)); \
STREAM_WARN_OFFSETS(S); \
diff --git a/lib/vrf.c b/lib/vrf.c
index f4fdd5342..eca9913e1 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -490,7 +490,7 @@ void vrf_init(int (*create)(struct vrf *), int (*enable)(struct vrf *),
default_vrf = vrf_get(VRF_DEFAULT, VRF_DEFAULT_NAME);
if (!default_vrf) {
flog_err(EC_LIB_VRF_START,
- "vrf_init: failed to create the default VRF!");
+ "vrf_init: failed to create the default VRF!");
exit(1);
}
if (vrf_is_backend_netns()) {
@@ -506,7 +506,7 @@ void vrf_init(int (*create)(struct vrf *), int (*enable)(struct vrf *),
/* Enable the default VRF. */
if (!vrf_enable(default_vrf)) {
flog_err(EC_LIB_VRF_START,
- "vrf_init: failed to enable the default VRF!");
+ "vrf_init: failed to enable the default VRF!");
exit(1);
}
diff --git a/lib/vty.c b/lib/vty.c
index 1831c117e..f812dd427 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2420,9 +2420,8 @@ static void vty_read_file(FILE *confp)
nl = strchr(vty->error_buf, '\n');
if (nl)
*nl = '\0';
- flog_err(EC_LIB_VTY,
- "ERROR: %s on config line %u: %s", message, line_num,
- vty->error_buf);
+ flog_err(EC_LIB_VTY, "ERROR: %s on config line %u: %s", message,
+ line_num, vty->error_buf);
}
vty_close(vty);
@@ -2523,8 +2522,8 @@ bool vty_read_config(const char *config_file, char *config_default_dir)
"WARNING: using backup configuration file!");
else {
flog_err(EC_LIB_VTY,
- "can't open configuration file [%s]",
- config_file);
+ "can't open configuration file [%s]",
+ config_file);
exit(1);
}
}
@@ -2574,8 +2573,8 @@ bool vty_read_config(const char *config_file, char *config_default_dir)
fullpath = config_default_dir;
} else {
flog_err(EC_LIB_VTY,
- "can't open configuration file [%s]",
- config_default_dir);
+ "can't open configuration file [%s]",
+ config_default_dir);
goto tmp_free_and_out;
}
} else
diff --git a/lib/zclient.c b/lib/zclient.c
index 56c47d2b1..1cdf4ff22 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -315,9 +315,10 @@ int zclient_read_header(struct stream *s, int sock, uint16_t *size,
STREAM_GETW(s, *cmd);
if (*version != ZSERV_VERSION || *marker != ZEBRA_HEADER_MARKER) {
- flog_err(EC_LIB_ZAPI_MISSMATCH,
- "%s: socket %d version mismatch, marker %d, version %d",
- __func__, sock, *marker, *version);
+ flog_err(
+ EC_LIB_ZAPI_MISSMATCH,
+ "%s: socket %d version mismatch, marker %d, version %d",
+ __func__, sock, *marker, *version);
return -1;
}
@@ -819,11 +820,11 @@ int zapi_route_encode(uint8_t cmd, struct stream *s, struct zapi_route *api)
prefix2str(&api->prefix, buf,
sizeof(buf));
flog_err(EC_LIB_ZAPI_ENCODE,
- "%s: prefix %s: can't encode "
- "%u labels (maximum is %u)",
- __func__, buf,
- api_nh->label_num,
- MPLS_MAX_LABELS);
+ "%s: prefix %s: can't encode "
+ "%u labels (maximum is %u)",
+ __func__, buf,
+ api_nh->label_num,
+ MPLS_MAX_LABELS);
return -1;
}
@@ -1451,10 +1452,11 @@ static void link_params_set_value(struct stream *s, struct if_link_params *iflp)
for (i = 0; i < bwclassnum && i < MAX_CLASS_TYPE; i++)
iflp->unrsv_bw[i] = stream_getf(s);
if (i < bwclassnum)
- flog_err(EC_LIB_ZAPI_MISSMATCH,
- "%s: received %d > %d (MAX_CLASS_TYPE) bw entries"
- " - outdated library?",
- __func__, bwclassnum, MAX_CLASS_TYPE);
+ flog_err(
+ EC_LIB_ZAPI_MISSMATCH,
+ "%s: received %d > %d (MAX_CLASS_TYPE) bw entries"
+ " - outdated library?",
+ __func__, bwclassnum, MAX_CLASS_TYPE);
}
iflp->admin_grp = stream_getl(s);
iflp->rmt_as = stream_getl(s);
@@ -1484,8 +1486,8 @@ struct interface *zebra_interface_link_params_read(struct stream *s)
if (ifp == NULL) {
flog_err(EC_LIB_ZAPI_ENCODE,
- "%s: unknown ifindex %u, shouldn't happen", __func__,
- ifindex);
+ "%s: unknown ifindex %u, shouldn't happen", __func__,
+ ifindex);
return NULL;
}
@@ -1823,8 +1825,8 @@ static int zclient_read_sync_response(struct zclient *zclient,
size);
}
if (ret != 0) {
- flog_err(EC_LIB_ZAPI_ENCODE,
- "%s: Invalid Sync Message Reply", __func__);
+ flog_err(EC_LIB_ZAPI_ENCODE, "%s: Invalid Sync Message Reply",
+ __func__);
return -1;
}
@@ -1893,13 +1895,15 @@ int lm_label_manager_connect(struct zclient *zclient)
/* sanity */
if (proto != zclient->redist_default)
- flog_err(EC_LIB_ZAPI_ENCODE,
- "Wrong proto (%u) in LM connect response. Should be %u",
- proto, zclient->redist_default);
+ flog_err(
+ EC_LIB_ZAPI_ENCODE,
+ "Wrong proto (%u) in LM connect response. Should be %u",
+ proto, zclient->redist_default);
if (instance != zclient->instance)
- flog_err(EC_LIB_ZAPI_ENCODE,
- "Wrong instId (%u) in LM connect response. Should be %u",
- instance, zclient->instance);
+ flog_err(
+ EC_LIB_ZAPI_ENCODE,
+ "Wrong instId (%u) in LM connect response. Should be %u",
+ instance, zclient->instance);
/* result code */
result = stream_getc(s);
@@ -1988,15 +1992,13 @@ int lm_get_label_chunk(struct zclient *zclient, uint8_t keep,
ret = writen(zclient->sock, s->data, stream_get_endp(s));
if (ret < 0) {
- flog_err(EC_LIB_ZAPI_SOCKET,
- "Can't write to zclient sock");
+ flog_err(EC_LIB_ZAPI_SOCKET, "Can't write to zclient sock");
close(zclient->sock);
zclient->sock = -1;
return -1;
}
if (ret == 0) {
- flog_err(EC_LIB_ZAPI_SOCKET,
- "Zclient sock closed");
+ flog_err(EC_LIB_ZAPI_SOCKET, "Zclient sock closed");
close(zclient->sock);
zclient->sock = -1;
return -1;
@@ -2018,12 +2020,12 @@ int lm_get_label_chunk(struct zclient *zclient, uint8_t keep,
/* sanities */
if (proto != zclient->redist_default)
flog_err(EC_LIB_ZAPI_ENCODE,
- "Wrong proto (%u) in get chunk response. Should be %u",
- proto, zclient->redist_default);
+ "Wrong proto (%u) in get chunk response. Should be %u",
+ proto, zclient->redist_default);
if (instance != zclient->instance)
flog_err(EC_LIB_ZAPI_ENCODE,
- "Wrong instId (%u) in get chunk response Should be %u",
- instance, zclient->instance);
+ "Wrong instId (%u) in get chunk response Should be %u",
+ instance, zclient->instance);
/* keep */
response_keep = stream_getc(s);
@@ -2033,15 +2035,16 @@ int lm_get_label_chunk(struct zclient *zclient, uint8_t keep,
/* not owning this response */
if (keep != response_keep) {
- flog_err(EC_LIB_ZAPI_ENCODE,
- "Invalid Label chunk: %u - %u, keeps mismatch %u != %u",
- *start, *end, keep, response_keep);
+ flog_err(
+ EC_LIB_ZAPI_ENCODE,
+ "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) {
- flog_err(EC_LIB_ZAPI_ENCODE,
- "Invalid Label chunk: %u - %u", *start, *end);
+ flog_err(EC_LIB_ZAPI_ENCODE, "Invalid Label chunk: %u - %u",
+ *start, *end);
return -1;
}
@@ -2097,8 +2100,7 @@ int lm_release_label_chunk(struct zclient *zclient, uint32_t start,
return -1;
}
if (ret == 0) {
- flog_err(EC_LIB_ZAPI_SOCKET,
- "Zclient sock connection closed");
+ flog_err(EC_LIB_ZAPI_SOCKET, "Zclient sock connection closed");
close(zclient->sock);
zclient->sock = -1;
return -1;
@@ -2201,15 +2203,15 @@ int tm_get_table_chunk(struct zclient *zclient, uint32_t chunk_size,
ret = writen(zclient->sock, s->data, stream_get_endp(s));
if (ret < 0) {
- flog_err(EC_LIB_ZAPI_SOCKET,
- "%s: can't write to zclient->sock", __func__);
+ flog_err(EC_LIB_ZAPI_SOCKET, "%s: can't write to zclient->sock",
+ __func__);
close(zclient->sock);
zclient->sock = -1;
return -1;
}
if (ret == 0) {
flog_err(EC_LIB_ZAPI_SOCKET,
- "%s: zclient->sock connection closed", __func__);
+ "%s: zclient->sock connection closed", __func__);
close(zclient->sock);
zclient->sock = -1;
return -1;
@@ -2295,8 +2297,7 @@ int zebra_send_pw(struct zclient *zclient, int command, struct zapi_pw *pw)
stream_write(s, (uint8_t *)&pw->nexthop.ipv6, 16);
break;
default:
- flog_err(EC_LIB_ZAPI_ENCODE,
- "%s: unknown af", __func__);
+ flog_err(EC_LIB_ZAPI_ENCODE, "%s: unknown af", __func__);
return -1;
}
@@ -2398,16 +2399,17 @@ static int zclient_read(struct thread *thread)
command = stream_getw(zclient->ibuf);
if (marker != ZEBRA_HEADER_MARKER || version != ZSERV_VERSION) {
- flog_err(EC_LIB_ZAPI_MISSMATCH,
- "%s: socket %d version mismatch, marker %d, version %d",
- __func__, zclient->sock, marker, version);
+ flog_err(
+ EC_LIB_ZAPI_MISSMATCH,
+ "%s: socket %d version mismatch, marker %d, version %d",
+ __func__, zclient->sock, marker, version);
return zclient_failed(zclient);
}
if (length < ZEBRA_HEADER_SIZE) {
flog_err(EC_LIB_ZAPI_MISSMATCH,
- "%s: socket %d message length %u is less than %d ",
- __func__, zclient->sock, length, ZEBRA_HEADER_SIZE);
+ "%s: socket %d message length %u is less than %d ",
+ __func__, zclient->sock, length, ZEBRA_HEADER_SIZE);
return zclient_failed(zclient);
}