summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrenato <renato@openbsd.org>2015-07-21 05:42:50 +0000
committerrenato <renato@openbsd.org>2015-07-21 05:42:50 +0000
commita30e0672d0886167bade98ac9548a3b2c35c5021 (patch)
tree8a6d56a1bc0186ac8a5f87d61321c5569ac4479f
parentAdded mpw(4) man page. (diff)
downloadwireguard-openbsd-a30e0672d0886167bade98ac9548a3b2c35c5021.tar.xz
wireguard-openbsd-a30e0672d0886167bade98ac9548a3b2c35c5021.zip
Improve the show lib command.
ok claudio@
-rw-r--r--usr.sbin/ldpctl/ldpctl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/ldpctl/ldpctl.c b/usr.sbin/ldpctl/ldpctl.c
index d6db8150783..56fc1a38f9a 100644
--- a/usr.sbin/ldpctl/ldpctl.c
+++ b/usr.sbin/ldpctl/ldpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpctl.c,v 1.18 2015/04/04 16:29:48 renato Exp $
+/* $OpenBSD: ldpctl.c,v 1.19 2015/07/21 05:42:50 renato Exp $
*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -372,9 +372,11 @@ show_lib_msg(struct imsg *imsg)
if (asprintf(&dstnet, "%s/%d", inet_ntoa(rt->prefix),
rt->prefixlen) == -1)
err(1, NULL);
-
- if (rt->remote_label == NO_LABEL) {
- if (asprintf(&remote, "No Label") == -1)
+ if (!rt->in_use) {
+ if (asprintf(&remote, "-") == -1)
+ err(1, NULL);
+ } else if (rt->connected || rt->remote_label == NO_LABEL) {
+ if (asprintf(&remote, "Untagged") == -1)
err(1, NULL);
} else if (rt->remote_label == MPLS_LABEL_IMPLNULL) {
if (asprintf(&remote, "Pop tag") == -1)