diff options
author | Renato Westphal <renato@cvs.openbsd.org> | 2013-10-15 20:31:15 +0000 |
---|---|---|
committer | Renato Westphal <renato@cvs.openbsd.org> | 2013-10-15 20:31:15 +0000 |
commit | ce8e1035c115cc6ad3ee8c97c20bc21842f743ce (patch) | |
tree | b9beec15a2b2e895146f164966ecb71b3f02a600 /usr.sbin | |
parent | 56db73e157626c3b6e308d7faeebf40efc9e9897 (diff) |
Improve debug and error logs.
OK claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ldpd/hello.c | 4 | ||||
-rw-r--r-- | usr.sbin/ldpd/neighbor.c | 15 | ||||
-rw-r--r-- | usr.sbin/ldpd/notification.c | 4 | ||||
-rw-r--r-- | usr.sbin/ldpd/packet.c | 5 |
4 files changed, 15 insertions, 13 deletions
diff --git a/usr.sbin/ldpd/hello.c b/usr.sbin/ldpd/hello.c index fff514570fd..05c140eebde 100644 --- a/usr.sbin/ldpd/hello.c +++ b/usr.sbin/ldpd/hello.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hello.c,v 1.22 2013/10/15 20:21:24 renato Exp $ */ +/* $OpenBSD: hello.c,v 1.23 2013/10/15 20:31:13 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -146,7 +146,7 @@ recv_hello(struct iface *iface, struct in_addr src, char *buf, u_int16_t len) } else { if (ldp.lspace_id != 0) { log_debug("recv_hello: invalid label space " - "ID %s, interface %s", ldp.lspace_id, + "ID %u, interface %s", ldp.lspace_id, iface->name); return; } diff --git a/usr.sbin/ldpd/neighbor.c b/usr.sbin/ldpd/neighbor.c index 8e703cec584..1cbc6432121 100644 --- a/usr.sbin/ldpd/neighbor.c +++ b/usr.sbin/ldpd/neighbor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: neighbor.c,v 1.39 2013/10/15 20:21:26 renato Exp $ */ +/* $OpenBSD: neighbor.c,v 1.40 2013/10/15 20:31:13 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -340,7 +340,7 @@ nbr_ktimeout(int fd, short event, void *arg) { struct nbr *nbr = arg; - log_debug("nbr_ktimeout: neighbor ID %s peerid %lu", inet_ntoa(nbr->id), + log_debug("nbr_ktimeout: neighbor ID %s peerid %u", inet_ntoa(nbr->id), nbr->peerid); session_shutdown(nbr, S_KEEPALIVE_TMR, 0, 0); @@ -373,7 +373,7 @@ nbr_idtimer(int fd, short event, void *arg) { struct nbr *nbr = arg; - log_debug("nbr_idtimer: neighbor ID %s peerid %lu", inet_ntoa(nbr->id), + log_debug("nbr_idtimer: neighbor ID %s peerid %u", inet_ntoa(nbr->id), nbr->peerid); if (nbr_session_active_role(nbr)) @@ -454,7 +454,8 @@ nbr_connect_cb(int fd, short event, void *arg) close(nbr->fd); errno = error; log_debug("nbr_connect_cb: error while " - "connecting to %s", inet_ntoa(nbr->addr)); + "connecting to %s: %s", inet_ntoa(nbr->addr), + strerror(errno)); return; } @@ -470,7 +471,7 @@ nbr_establish_connection(struct nbr *nbr) nbr->fd = socket(AF_INET, SOCK_STREAM, 0); if (nbr->fd == -1) { - log_debug("nbr_establish_connection: error while " + log_warn("nbr_establish_connection: error while " "creating socket"); return (-1); } @@ -484,7 +485,7 @@ nbr_establish_connection(struct nbr *nbr) if (bind(nbr->fd, (struct sockaddr *) &local_sa, sizeof(struct sockaddr_in)) == -1) { - log_debug("nbr_establish_connection: error while " + log_warn("nbr_establish_connection: error while " "binding socket to %s", inet_ntoa(local_sa.sin_addr)); close(nbr->fd); return (-1); @@ -511,7 +512,7 @@ nbr_establish_connection(struct nbr *nbr) event_add(&nbr->ev_connect, NULL); return (0); } - log_debug("nbr_establish_connection: error while " + log_warn("nbr_establish_connection: error while " "connecting to %s", inet_ntoa(nbr->addr)); close(nbr->fd); return (-1); diff --git a/usr.sbin/ldpd/notification.c b/usr.sbin/ldpd/notification.c index 320dd1cc99c..6395585507a 100644 --- a/usr.sbin/ldpd/notification.c +++ b/usr.sbin/ldpd/notification.c @@ -1,4 +1,4 @@ -/* $OpenBSD: notification.c,v 1.15 2013/10/15 19:59:53 renato Exp $ */ +/* $OpenBSD: notification.c,v 1.16 2013/10/15 20:31:13 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -43,6 +43,8 @@ void send_notification_nbr(struct nbr *nbr, u_int32_t status, u_int32_t msgid, u_int32_t type) { + log_debug("send_notification_nbr: nbr ID %s, status %s", + inet_ntoa(nbr->id), notification_name(status)); send_notification(status, nbr->tcp, msgid, type); nbr_fsm(nbr, NBR_EVT_PDU_SENT); } diff --git a/usr.sbin/ldpd/packet.c b/usr.sbin/ldpd/packet.c index fe923aa5f8b..8172e09a3e8 100644 --- a/usr.sbin/ldpd/packet.c +++ b/usr.sbin/ldpd/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.31 2013/10/15 20:27:40 renato Exp $ */ +/* $OpenBSD: packet.c,v 1.32 2013/10/15 20:31:14 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -526,8 +526,7 @@ void session_shutdown(struct nbr *nbr, u_int32_t status, u_int32_t msgid, u_int32_t type) { - log_debug("session_shutdown: nbr ID %s, status %x", - inet_ntoa(nbr->id), status); + log_debug("session_shutdown: nbr ID %s", inet_ntoa(nbr->id)); send_notification_nbr(nbr, status, msgid, type); |