]> git.stg.codes - ssmd.git/commitdiff
Ommit "too big" error
authorMaxim Mamontov <faust.madf@gmail.com>
Mon, 28 Nov 2011 13:29:51 +0000 (15:29 +0200)
committerMaxim Mamontov <faust.madf@gmail.com>
Mon, 28 Nov 2011 13:29:51 +0000 (15:29 +0200)
src/snmptable.cpp
src/switch.cpp

index 5937270e23defc60d9adb4f2da33f14acb05e8f0..e729b058ca4c65d2a3e7e11ef3b752c1c9fbf10f 100644 (file)
@@ -11,7 +11,11 @@ SNMPTable::SNMPTable(Snmp & snmp,
     Vb vb(oid);
     Pdu pdu(&vb, 1);
     while (true) {
-        if (int c = snmp.get_next(pdu, target) != SNMP_CLASS_SUCCESS) {
+        int c = snmp.get_next(pdu, target);
+        for (size_t i = 0; i < 3 && c != SNMP_CLASS_SUCCESS; ++i) {
+            c = snmp.get_next(pdu, target);
+        }
+        if (c != SNMP_CLASS_SUCCESS) {
             logger << "SNMPTable::SNMPTable() - failed to invoke Snmp::get_next (oid: '" << oid.get_printable() << "'). Error message: '" << Snmp::error_msg(c) << "'" << std::endl;
             return;
         }
index 01024a13d4d8e5b60bf8fb55dba646a4846cbe69..f189ba6f30b2509afb112aec38e9ff0f3c636f1b 100644 (file)
@@ -221,8 +221,10 @@ bool Switch::dropACLsByTable(const CTarget & target, unsigned profileId, const S
             pdu += vb;
         }
         if (int c = _snmp.set(pdu, target) != SNMP_CLASS_SUCCESS) {
-            logger << "Switch::dropACLsByTable() - failed to invoke Snmp::set for the switch '" << _ip << "'. Error message: '" << Snmp::error_msg(c) << "'" << std::endl;
-            return false;
+            if (c != SNMP_ERROR_TOO_BIG) {
+                logger << "Switch::dropACLsByTable() - failed to invoke Snmp::set for the switch '" << _ip << "'. Error message: '" << Snmp::error_msg(c) << "'" << std::endl;
+                return false;
+            }
         }
     }
     return true;
@@ -236,9 +238,11 @@ bool Switch::createACLs(const CTarget & target)
         Pdu pdu;
         it->appendPdu(pdu);
         if (int c = _snmp.set(pdu, target) != SNMP_CLASS_SUCCESS) {
-            logger << "Switch::createACLs() - failed to invoke Snmp::set for the switch '" << _ip << "'. Error message: '" << Snmp::error_msg(c) << "'. Error occured at creation of " << (pos + 1) << " from " << _acls.size() << " ACL's" << std::endl;
-            logger << "Switch::createACLs() - ACL dump: " << *it << std::endl;
-            return false;
+            if (c != SNMP_ERROR_TOO_BIG) {
+                logger << "Switch::createACLs() - failed to invoke Snmp::set for the switch '" << _ip << "'. Error message: '" << Snmp::error_msg(c) << "'. Error occured at creation of " << (pos + 1) << " from " << _acls.size() << " ACL's" << std::endl;
+                logger << "Switch::createACLs() - ACL dump: " << *it << std::endl;
+                return false;
+            }
         }
         _aclsCreated = true;
         ++pos;