summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dvmrpctl
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2006-11-28 19:21:15 +0000
committerreyk <reyk@openbsd.org>2006-11-28 19:21:15 +0000
commit307627386806be0bc5eb7752d727b7ee499ed0a7 (patch)
tree9f8c64c381831baefec1b2e0e88a0893c9706702 /usr.sbin/dvmrpctl
parentSupport "trace /p <pid>" to show the stack trace of any process. (diff)
downloadwireguard-openbsd-307627386806be0bc5eb7752d727b7ee499ed0a7.tar.xz
wireguard-openbsd-307627386806be0bc5eb7752d727b7ee499ed0a7.zip
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')
-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");