Commit 91d62162 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

inetmib1: Return SNMP_ERRORSTATUS_NOSUCHNAME for an interface's physical address if it has none.

parent 632b759f
......@@ -553,13 +553,30 @@ static INT setOidWithItemAndInteger(AsnObjectIdentifier *dst,
return ret;
}
static DWORD copyIfRowPhysAddr(AsnAny *value, void *src)
{
PMIB_IFROW row = (PMIB_IFROW)((BYTE *)src -
FIELD_OFFSET(MIB_IFROW, dwPhysAddrLen));
DWORD ret;
if (row->dwPhysAddrLen)
{
setStringValue(value, ASN_OCTETSTRING, row->dwPhysAddrLen,
row->bPhysAddr);
ret = SNMP_ERRORSTATUS_NOERROR;
}
else
ret = SNMP_ERRORSTATUS_NOSUCHNAME;
return ret;
}
static struct structToAsnValue mib2IfEntryMap[] = {
{ FIELD_OFFSET(MIB_IFROW, dwIndex), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwDescrLen), copyLengthPrecededString },
{ FIELD_OFFSET(MIB_IFROW, dwType), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwMtu), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwSpeed), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwPhysAddrLen), copyLengthPrecededString },
{ FIELD_OFFSET(MIB_IFROW, dwPhysAddrLen), copyIfRowPhysAddr },
{ FIELD_OFFSET(MIB_IFROW, dwAdminStatus), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwOperStatus), copyOperStatus },
{ FIELD_OFFSET(MIB_IFROW, dwLastChange), copyInt },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment