diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2006-11-28 19:21:17 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2006-11-28 19:21:17 +0000 |
commit | 42dc4672e2746e5183c5a29733c654f4a9644cce (patch) | |
tree | df76318348d55acb95fe86483447a0ed376640df /usr.sbin/ospfctl/ospfctl.c | |
parent | 0e1919712e2589382b2029732a09c5ce9488a2cb (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/ospfctl/ospfctl.c')
-rw-r--r-- | usr.sbin/ospfctl/ospfctl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/ospfctl/ospfctl.c b/usr.sbin/ospfctl/ospfctl.c index 47777fe638d..f8bfaaf3b2e 100644 --- a/usr.sbin/ospfctl/ospfctl.c +++ b/usr.sbin/ospfctl/ospfctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfctl.c,v 1.35 2006/08/23 08:26:03 claudio Exp $ */ +/* $OpenBSD: ospfctl.c,v 1.36 2006/11/28 19:21:15 reyk Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -1198,7 +1198,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"); |