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

Alexandre Julliard julliard at winehq.org
Tue Dec 8 11:10:36 CST 2009


Module: wine
Branch: master
Commit: 91d62162da316f7a25781ea1a88460aa237a116b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=91d62162da316f7a25781ea1a88460aa237a116b

Author: Juan Lang <juan.lang at gmail.com>
Date:   Mon Dec  7 13:18:02 2009 -0800

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

---

 dlls/inetmib1/main.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/dlls/inetmib1/main.c b/dlls/inetmib1/main.c
index 204c0e2..2a5f97a 100644
--- a/dlls/inetmib1/main.c
+++ b/dlls/inetmib1/main.c
@@ -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 },




More information about the wine-cvs mailing list