summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpd/lde_lib.c
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/ldpd/lde_lib.c
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/ldpd/lde_lib.c')
-rw-r--r--usr.sbin/ldpd/lde_lib.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/ldpd/lde_lib.c b/usr.sbin/ldpd/lde_lib.c
index a6022a83dd5..7a4b319c685 100644
--- a/usr.sbin/ldpd/lde_lib.c
+++ b/usr.sbin/ldpd/lde_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lde_lib.c,v 1.6 2009/09/28 09:48:46 michele Exp $ */
+/* $OpenBSD: lde_lib.c,v 1.7 2010/01/02 14:56:02 michele Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -111,9 +111,6 @@ rt_dump(pid_t pid)
static struct ctl_rt rtctl;
RB_FOREACH(r, rt_tree, &rt) {
- if (!r->present)
- continue;
-
rtctl.prefix.s_addr = r->prefix.s_addr;
rtctl.prefixlen = r->prefixlen;
rtctl.nexthop.s_addr = r->nexthop.s_addr;
@@ -121,6 +118,11 @@ rt_dump(pid_t pid)
rtctl.local_label = r->local_label;
rtctl.remote_label = r->remote_label;
+ if (!r->present)
+ rtctl.in_use = 0;
+ else
+ rtctl.in_use = 1;
+
if (rtctl.nexthop.s_addr == htonl(INADDR_LOOPBACK))
rtctl.connected = 1;
else