[AGENT++] Failing to validate MibLeaf object with latest version of the agent?

Fedja Jeleskovic mrawd2 at gmail.com
Wed Dec 7 22:57:49 CET 2005


Well, I am still in process of fixing all of the bugs that showed up since my upgrade from 3.5.16 to 3.5.24 and I have found the following issue and I was wondering what to do about it. Basically, new code from 
MibLeaf::get_request (see below) is checking now for the validity of the object (wasn't before) and my table ends up short for those objects that are not initialized to even dummy values. So, if I initialize those missing values in the TableEntry constructor, then values get valid and I could use my previous way of getting data successfully (in the get_request, I would call set_state with the correct value and that would be successfully returned).

So, am I doing the right thing now, or there is better way to initialize the table and return those values?

Thanks


Fedja


ps. snippet of the new code from the mib.cpp:
void MibLeaf::get_request(Request* req, int ind)
{
 if (get_access() >= READONLY) {
  if ((my_table) && (valid() == 0)) {
   Vbx vb(req->get_oid(ind));
   vb.set_syntax(sNMP_SYNTAX_NOSUCHINSTANCE);
   req->finish(ind, vb);
  }
  else {
   req->finish(ind, get_value());
  }
 }
 else {
     req->error(ind, SNMP_ERROR_NO_ACCESS);
 }
}



More information about the AGENTPP mailing list