summaryrefslogtreecommitdiff
path: root/usr.sbin/dvmrpctl/dvmrpctl.c
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 /usr.sbin/dvmrpctl/dvmrpctl.c
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 'usr.sbin/dvmrpctl/dvmrpctl.c')
-rw-r--r--usr.sbin/dvmrpctl/dvmrpctl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/dvmrpctl/dvmrpctl.c b/usr.sbin/dvmrpctl/dvmrpctl.c
index 6d75de6f2fa..1940e9d55ef 100644
--- a/usr.sbin/dvmrpctl/dvmrpctl.c
+++ b/usr.sbin/dvmrpctl/dvmrpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dvmrpctl.c,v 1.1 2006/06/01 14:21:28 norby Exp $ */
+/* $OpenBSD: dvmrpctl.c,v 1.2 2006/11/28 19:21:15 reyk Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -680,7 +680,9 @@ get_linkstate(int media_type, 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]);
}
return ("unknown link state");