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

Alexandre Julliard julliard at winehq.org
Wed Dec 9 10:46:26 CST 2009


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

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

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

---

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

diff --git a/dlls/inetmib1/main.c b/dlls/inetmib1/main.c
index 2a5f97a..f11bc3b 100644
--- a/dlls/inetmib1/main.c
+++ b/dlls/inetmib1/main.c
@@ -553,6 +553,22 @@ static INT setOidWithItemAndInteger(AsnObjectIdentifier *dst,
     return ret;
 }
 
+static DWORD copyIfRowDescr(AsnAny *value, void *src)
+{
+    PMIB_IFROW row = (PMIB_IFROW)((BYTE *)src -
+                                  FIELD_OFFSET(MIB_IFROW, dwDescrLen));
+    DWORD ret;
+
+    if (row->dwDescrLen)
+    {
+        setStringValue(value, ASN_OCTETSTRING, row->dwDescrLen, row->bDescr);
+        ret = SNMP_ERRORSTATUS_NOERROR;
+    }
+    else
+        ret = SNMP_ERRORSTATUS_NOSUCHNAME;
+    return ret;
+}
+
 static DWORD copyIfRowPhysAddr(AsnAny *value, void *src)
 {
     PMIB_IFROW row = (PMIB_IFROW)((BYTE *)src -
@@ -572,7 +588,7 @@ static DWORD copyIfRowPhysAddr(AsnAny *value, void *src)
 
 static struct structToAsnValue mib2IfEntryMap[] = {
     { FIELD_OFFSET(MIB_IFROW, dwIndex), copyInt },
-    { FIELD_OFFSET(MIB_IFROW, dwDescrLen), copyLengthPrecededString },
+    { FIELD_OFFSET(MIB_IFROW, dwDescrLen), copyIfRowDescr },
     { FIELD_OFFSET(MIB_IFROW, dwType), copyInt },
     { FIELD_OFFSET(MIB_IFROW, dwMtu), copyInt },
     { FIELD_OFFSET(MIB_IFROW, dwSpeed), copyInt },




More information about the wine-cvs mailing list