summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpctl
diff options
context:
space:
mode:
authorMichele Marchetto <michele@cvs.openbsd.org>2010-01-02 14:56:03 +0000
committerMichele Marchetto <michele@cvs.openbsd.org>2010-01-02 14:56:03 +0000
commitaff3274111529b89e10ce565f8569e204c90b767 (patch)
tree847acd6cc32403cd3b36829ac4bcaefafadcbe8d /usr.sbin/ldpctl
parent57ba16f7736ffaade1dfd055e91481bcb2ddcaef (diff)
In the "ldpctl show lib" output print every known label and make clear if it
is currently in use or not. ok claudio@
Diffstat (limited to 'usr.sbin/ldpctl')
-rw-r--r--usr.sbin/ldpctl/ldpctl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/ldpctl/ldpctl.c b/usr.sbin/ldpctl/ldpctl.c
index 5369d86b928..0388149326a 100644
--- a/usr.sbin/ldpctl/ldpctl.c
+++ b/usr.sbin/ldpctl/ldpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpctl.c,v 1.6 2009/11/02 20:35:20 claudio Exp $
+/* $OpenBSD: ldpctl.c,v 1.7 2010/01/02 14:56:02 michele Exp $
*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -117,8 +117,8 @@ main(int argc, char *argv[])
imsg_compose(ibuf, IMSG_CTL_SHOW_NBR, 0, 0, -1, NULL, 0);
break;
case SHOW_LIB:
- printf("%-20s %-17s %-17s %s\n", "Destination",
- "Nexthop", "Local Label", "Remote Label");
+ printf("%-20s %-17s %-14s %-14s %-10s\n", "Destination",
+ "Nexthop", "Local Label", "Remote Label", "In Use");
imsg_compose(ibuf, IMSG_CTL_SHOW_LIB, 0, 0, -1, NULL, 0);
break;
case SHOW_LFIB:
@@ -328,7 +328,7 @@ show_lib_msg(struct imsg *imsg)
rt->prefixlen) == -1)
err(1, NULL);
- if (rt->connected) {
+ if (rt->connected || !rt->in_use) {
if (asprintf(&remote, "-") == -1)
err(1, NULL);
} else {
@@ -336,10 +336,10 @@ show_lib_msg(struct imsg *imsg)
err(1, NULL);
}
- printf("%-20s %-17s %-17u %s\n", dstnet,
+ printf("%-20s %-17s %-14u %-14s %s\n", dstnet,
inet_ntoa(rt->nexthop),
(ntohl(rt->local_label) >> MPLS_LABEL_OFFSET),
- remote);
+ remote, rt->in_use ? "yes" : "no");
free(remote);
free(dstnet);