Illegal instruction in send_v2trap(), any thoughts?

This is a discussion on Illegal instruction in send_v2trap(), any thoughts? within the SNMP Users forums, part of the Networking and Network Related category; I realize this is a long shot, that I'm behind revisions, and all that but have a little pity ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-05-2005
cnelson@nycap.rr.com
 
Posts: n/a
Default Illegal instruction in send_v2trap(), any thoughts?

I realize this is a long shot, that I'm behind revisions, and all that
but have a little pity on me, please, I'm working with an old embedded
system.

Recently, I've seen a problem in send_v2trap() that's fairly easy to
reproduce (though with a sequence that's very specific to my system and
I don't know that I can generalize it; I'll work on that). I'm using
Net-SNMP 5.1.1, cross-compiled from Intel to PPC Linux and calling
send_v2trap() results in an Illegal Instruction error. The code looks like:

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

// 0 overwritten below with 3 (down) or 4 (up)
oid notification_oid[] = {1, 3, 6, 1, 6, 3, 1, 1, 5, 0 };
size_t notification_oid_len = OID_LENGTH(notification_oid);

oid ifindex_oid[] = { 1, 3, 6, 1, 2, 1, 2, 2, 1, 1 };
size_t ifindex_oidlen = OID_LENGTH(ifindex_oid);

netsnmp_variable_list *notification_vars = NULL;

static int port;

if (port->MAC_Operational)
notification_oid[notification_oid_len-1] = 4; // Up
else
notification_oid[notification_oid_len-1] = 3; // Down

/*
* add in the trap definition object
*/
snmp_varlist_add_variable(&notification_vars,
objid_snmptrap, objid_snmptrap_len,
ASN_OBJECT_ID,
(u_char*)notification_oid,
notification_oid_len * sizeof(oid));

/* and the interface number */
port = port->portId;
snmp_varlist_add_variable(&notification_vars,
ifindex_oid, ifindex_oidlen,
ASN_INTEGER,
(u_char*)&port,
sizeof(port));
/*
* send the trap out. This will send it to all registered
* receivers (see the "SETTING UP TRAP AND/OR INFORM
* DESTINATIONS" section of the snmpd.conf manual page. */
send_v2trap(notification_vars);

I've peppered this with "printf("%s:%d\n", __FILE__, __LINE__)" and I
get to the line before send_v2trap() but never the line after. I'll dig
into the code, put in more debugging, etc. but any Net-SNMP-unique
insight would be appreciated. Thanks.

Chris


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:23 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0