diff options
Diffstat (limited to 'bfdd/control.c')
| -rw-r--r-- | bfdd/control.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/bfdd/control.c b/bfdd/control.c index ae6f5a3e79..4adc54a64a 100644 --- a/bfdd/control.c +++ b/bfdd/control.c @@ -86,13 +86,13 @@ static int sock_set_nonblock(int fd) flags = fcntl(fd, F_GETFL, 0); if (flags == -1) { - log_warning("%s: fcntl F_GETFL: %s", __func__, strerror(errno)); + zlog_warn("%s: fcntl F_GETFL: %s", __func__, strerror(errno)); return -1; } flags |= O_NONBLOCK; if (fcntl(fd, F_SETFL, flags) == -1) { - log_warning("%s: fcntl F_SETFL: %s", __func__, strerror(errno)); + zlog_warn("%s: fcntl F_SETFL: %s", __func__, strerror(errno)); return -1; } @@ -116,20 +116,20 @@ int control_init(const char *path) sd = socket(AF_UNIX, SOCK_STREAM, PF_UNSPEC); if (sd == -1) { - log_error("%s: socket: %s", __func__, strerror(errno)); + zlog_err("%s: socket: %s", __func__, strerror(errno)); return -1; } umval = umask(0); if (bind(sd, (struct sockaddr *)&sun_, sizeof(sun_)) == -1) { - log_error("%s: bind: %s", __func__, strerror(errno)); + zlog_err("%s: bind: %s", __func__, strerror(errno)); close(sd); return -1; } umask(umval); if (listen(sd, SOMAXCONN) == -1) { - log_error("%s: listen: %s", __func__, strerror(errno)); + zlog_err("%s: listen: %s", __func__, strerror(errno)); close(sd); return -1; } @@ -164,7 +164,7 @@ int control_accept(struct thread *t) csock = accept(sd, NULL, 0); if (csock == -1) { - log_warning("%s: accept: %s", __func__, strerror(errno)); + zlog_warn("%s: accept: %s", __func__, strerror(errno)); return 0; } @@ -440,7 +440,7 @@ static int control_read(struct thread *t) if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) goto schedule_next_read; - log_warning("%s: read: %s", __func__, strerror(errno)); + zlog_warn("%s: read: %s", __func__, strerror(errno)); control_free(bcs); return 0; } @@ -448,15 +448,15 @@ static int control_read(struct thread *t) /* Validate header fields. */ plen = ntohl(bcm.bcm_length); if (plen < 2) { - log_debug("%s: client closed due small message length: %d", - __func__, bcm.bcm_length); + zlog_debug("%s: client closed due small message length: %d", + __func__, bcm.bcm_length); control_free(bcs); return 0; } if (bcm.bcm_ver != BMV_VERSION_1) { - log_debug("%s: client closed due bad version: %d", __func__, - bcm.bcm_ver); + zlog_debug("%s: client closed due bad version: %d", __func__, + bcm.bcm_ver); control_free(bcs); return 0; } @@ -470,8 +470,8 @@ static int control_read(struct thread *t) bcb->bcb_buf = XMALLOC(MTYPE_BFDD_NOTIFICATION, sizeof(bcm) + bcb->bcb_left + 1); if (bcb->bcb_buf == NULL) { - log_warning("%s: not enough memory for message size: %zu", - __func__, bcb->bcb_left); + zlog_warn("%s: not enough memory for message size: %zu", + __func__, bcb->bcb_left); control_free(bcs); return 0; } @@ -492,7 +492,7 @@ skip_header: if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) goto schedule_next_read; - log_warning("%s: read: %s", __func__, strerror(errno)); + zlog_warn("%s: read: %s", __func__, strerror(errno)); control_free(bcs); return 0; } @@ -521,8 +521,8 @@ skip_header: break; default: - log_debug("%s: unhandled message type: %d", __func__, - bcb->bcb_bcm->bcm_type); + zlog_debug("%s: unhandled message type: %d", __func__, + bcb->bcb_bcm->bcm_type); control_response(bcs, bcb->bcb_bcm->bcm_id, BCM_RESPONSE_ERROR, "invalid message type"); break; @@ -559,7 +559,7 @@ static int control_write(struct thread *t) return 0; } - log_warning("%s: write: %s", __func__, strerror(errno)); + zlog_warn("%s: write: %s", __func__, strerror(errno)); control_free(bcs); return 0; } @@ -723,8 +723,8 @@ static void control_response(struct bfd_control_socket *bcs, uint16_t id, /* Generate JSON response. */ jsonstr = config_response(status, error); if (jsonstr == NULL) { - log_warning("%s: config_response: failed to get JSON str", - __func__); + zlog_warn("%s: config_response: failed to get JSON str", + __func__); return; } @@ -753,8 +753,8 @@ static void _control_notify(struct bfd_control_socket *bcs, /* Generate JSON response. */ jsonstr = config_notify(bs); if (jsonstr == NULL) { - log_warning("%s: config_notify: failed to get JSON str", - __func__); + zlog_warn("%s: config_notify: failed to get JSON str", + __func__); return; } @@ -816,8 +816,8 @@ static void _control_notify_config(struct bfd_control_socket *bcs, /* Generate JSON response. */ jsonstr = config_notify_config(op, bs); if (jsonstr == NULL) { - log_warning("%s: config_notify_config: failed to get JSON str", - __func__); + zlog_warn("%s: config_notify_config: failed to get JSON str", + __func__); return; } |
