Properly detect interface's state in the LINK_STATE_UNKNOWN case.

MFC after:	1 week
This commit is contained in:
Ruslan Ermilov 2011-05-03 10:11:44 +00:00
parent a35a58824b
commit 87a5818245
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=221373

View File

@ -289,8 +289,7 @@ op_ifentry(struct snmp_context *ctx, struct snmp_value *value,
* cable) and hence return 'dormant'.
*/
if (ifp->mib.ifmd_flags & IFF_RUNNING) {
if (ifp->mib.ifmd_data.ifi_link_state ==
LINK_STATE_DOWN)
if (ifp->mib.ifmd_data.ifi_link_state != LINK_STATE_UP)
value->v.integer = 5; /* state dormant */
else
value->v.integer = 1; /* state up */