summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2004-01-22 03:09:29 +0000
committerhenning <henning@openbsd.org>2004-01-22 03:09:29 +0000
commit0c49e9e9af9a4e8b9fc5d54d6a0d68176b4da1bf (patch)
treeb163ea47514c07023a15c19275eca6fd0458b241
parentan RTM_IFINFO message can mean a lot. it does not necessarily mean that (diff)
downloadwireguard-openbsd-0c49e9e9af9a4e8b9fc5d54d6a0d68176b4da1bf.tar.xz
wireguard-openbsd-0c49e9e9af9a4e8b9fc5d54d6a0d68176b4da1bf.zip
print the interface state wrt the nexthop verification in the show interface
output. makes quite some sense so that not every reader has to know the algorithm for deciding on the interface state...
-rw-r--r--usr.sbin/bgpctl/bgpctl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c
index 5bea9cd2718..7fa5b744145 100644
--- a/usr.sbin/bgpctl/bgpctl.c
+++ b/usr.sbin/bgpctl/bgpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpctl.c,v 1.34 2004/01/21 23:47:35 henning Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.35 2004/01/22 03:09:29 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -494,7 +494,8 @@ show_nexthop_msg(struct imsg *imsg)
void
show_interface_head(void)
{
- printf("%-20s%-20s%-20s\n", "Interface", "Flags", "Link state");
+ printf("%-15s%-15s%-15s%s\n", "Interface", "Nexthop state", "Flags",
+ "Link state");
}
const int ifm_status_valid_list[] = IFM_STATUS_VALID_LIST;
@@ -558,8 +559,9 @@ show_interface_msg(struct imsg *imsg)
switch (imsg->hdr.type) {
case IMSG_CTL_SHOW_INTERFACE:
k = imsg->data;
- printf("%-20s", k->ifname);
- printf("%-20s", k->flags & IFF_UP ? "UP" : "");
+ printf("%-15s", k->ifname);
+ printf("%-15s", k->nh_reachable ? "ok" : "invalid");
+ printf("%-15s", k->flags & IFF_UP ? "UP" : "");
switch (k->media_type) {
case IFT_ETHER:
ifms_type = IFM_ETHER;