Hi,
Iam using Net-SNMP-5.4.2.1 version and generated the extension files using
mib2c.scalar.conf. It has mib attributes for both Integer type and string
type(ASN-OCTET-STRING - max length 40chars).
//sample code generated is like this//
case MODE_SET_ACTION:
/* XXX: perform the value change here */
printf("string is %s\n", requests->requestvb->val.string);
ret = strncpy(tmpbuf, requests->requestvb->val.string,
strlen(requests->requestvb->val.string));
printf("Out string is %s\n", requests->requestvb->val.string);
if (ret) {
netsnmp_set_request_error(reqinfo, requests, ret);
}
break;
case MODE_SET_COMMIT:
/* XXX: delete temporary storage */
// if (/* XXX: error? */) {
// /* try _really_really_ hard to never get to this point */
// netsnmp_set_request_error(reqinfo, requests,
SNMP_ERR_COMMITFAILED);
// }
break;
///////////////////////////////////////////
Setting is working fine for most of the times when I use the smaller
strings(6-10 chars).
When I tried to set a string with around 25 chars with some invalid characters
in between, Net-SNMP thrown the proper error message.
But next time when I tried set with some 10 chars, other 15 characters are
getting appended to the set string, and it says most of the times set failed,
after 4 or 5 retrials its working some how.
(From my observation, I feel that the '\0' character is not getting appended to
the string after 10 chars, causing the old buffer to append on top of it).
I want to know if this is a known issue and has a patch fix for it Or is it a
problem from the application side.
Thanks in advance,
Kishore
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users