summaryrefslogtreecommitdiff
path: root/sbin/route
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2006-11-28 19:21:17 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2006-11-28 19:21:17 +0000
commit42dc4672e2746e5183c5a29733c654f4a9644cce (patch)
treedf76318348d55acb95fe86483447a0ed376640df /sbin/route
parent0e1919712e2589382b2029732a09c5ce9488a2cb (diff)
add additional link states to report the half duplex / full duplex
state, if known by the driver. this is required to check the full duplex state without depending on the ifmedia ioctl which can't be called in the kernel without process context. ok henning@, brad@
Diffstat (limited to 'sbin/route')
-rw-r--r--sbin/route/route.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 52de6ed65be..b75cfa2550a 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.103 2006/11/28 16:48:13 henning Exp $ */
+/* $OpenBSD: route.c,v 1.104 2006/11/28 19:21:15 reyk Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
@@ -1112,7 +1112,9 @@ get_linkstate(int mt, int link_state)
if (p->ifms_type != media_type ||
p->ifms_valid != ifm_status_valid_list[i])
continue;
- return (p->ifms_string[link_state == LINK_STATE_UP]);
+ if (LINK_STATE_IS_UP(link_state))
+ return (p->ifms_string[1]);
+ return (p->ifms_string[0]);
}
}