summaryrefslogtreecommitdiff
path: root/usr.sbin/snmpd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2011-07-04 04:34:15 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2011-07-04 04:34:15 +0000
commite03be1c13da2627f88815c4221fd7aea1ef8f515 (patch)
treea68cb661597a54bfac8799839218986aea79977e /usr.sbin/snmpd
parent6558208a6b4fc7625013eefd861685b315297077 (diff)
LINK_STATE_IS_UP() cleanup userland part. There is no need to special
case carp(4) interfaces anymore. LINK_STATE_IS_UP() almost always does the right job. OK deraadt@ henning@ This needs a -current kernel or link state may be not reported correctly.
Diffstat (limited to 'usr.sbin/snmpd')
-rw-r--r--usr.sbin/snmpd/mib.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/snmpd/mib.c b/usr.sbin/snmpd/mib.c
index afaaab94819..9c088a63d03 100644
--- a/usr.sbin/snmpd/mib.c
+++ b/usr.sbin/snmpd/mib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mib.c,v 1.44 2011/04/10 03:20:59 guenther Exp $ */
+/* $OpenBSD: mib.c,v 1.45 2011/07/04 04:34:14 claudio Exp $ */
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@vantronix.net>
@@ -958,14 +958,14 @@ mib_iftable(struct oid *oid, struct ber_oid *o, struct ber_element **elm)
break;
case 8:
/* ifOperStatus */
- if ((kif->if_flags & IFF_UP) == 0) {
+ if ((kif->if_flags & IFF_UP) == 0)
i = 2; /* down(2) */
- } else if (LINK_STATE_IS_UP(kif->if_link_state)) {
+ else if (kif->if_link_state == LINK_STATE_UNKNOWN)
+ i = 4; /* unknown(4) */
+ else if (LINK_STATE_IS_UP(kif->if_link_state))
i = 1; /* up(1) */
- } else if (kif->if_link_state == LINK_STATE_DOWN) {
+ else
i = 7; /* lowerLayerDown(7) or dormant(5)? */
- } else
- i = 4; /* unknown(4) */
ber = ber_add_integer(ber, i);
break;
case 9: