Hello,

I wrote a small program that sends traps using the net snmp api.

Got a segmentation error when executing this program and on debugging it pointed
to a malloc inside method snmp_varlist_add_variable().

Is there any compatability issue with my gnu c library?

I use Red Hat 9
Kernel version is 2.4.20-8smp
gcc version is 3.2.2 20030222
glibc version is 2.3.2.


Here's a code snippet of my usage -

    oid             objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
    size_t          objid_snmptrap_len = OID_LENGTH(objid_snmptrap);  
oid         notification_oid[]={ 1, 3, 6, 1, 4, 1, 5517, 4, 1, 1, 1};
    size_t      notification_oid_len = OID_LENGTH(notification_oid);

   netsnmp_variable_list *notification_vars = NULL;
  
   snmp_varlist_add_variable(&notification_vars,
                              objid_snmptrap, objid_snmptrap_len,
                              ASN_OBJECT_ID,
                              (u_char *) notification_oid,
                              notification_oid_len * sizeof(oid));


Viren



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
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

Reply via email to