I have compiled my module into the agent,and run snmpset,first time I set a
long string:"aaaa",it's ok;next time,I set a shorter string:"bb",but the value
in the mib became "bbaaa",how could that happen?
my code related:
case MODE_SET_ACTION:
if ( sizeof(def_nodeType) < strlen(requests->requestvb->val.string) {
netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_WRONGLENGTH);
}
memset(def_nodeType,'\0',sizeof(def_nodeType));
printf("set node type:%s\n",def_nodeType);//output blank string
printf("val.string:%s\n",(u_char
*)requests->requestvb->val.string);//output "bbaaa"
memcpy(def_nodeType ,(u_char *)requests->requestvb->val.string
,strlen(requests->requestvb->val.string));
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders