On Tue, 2013-03-05 at 17:43 +0000, AR, Giridhar wrote:
> ...
> 
> But select system call is getting timedout for ipv6 address, Due to
> this traps are not received.
> timeout is set to 5 seonds, its code looks like

I assume the following is running inside of an infinite loop, is that
correct?
        
> numfds = 0;
> FD_ZERO(&fdset);
> block = 0;
> tvp = &timeout;
> timerclear(tvp);
> tvp->tv_sec = 5;
> snmp_select_info(&numfds, &fdset, tvp, &block);
> count = select(numfds, &fdset, 0, 0, tvp);


If you send a trap to the program within 5 seconds of you starting it,
do you receive that? Normally I would have used code like


numfds = 0;
FD_ZERO(&fdset);
block = 1;
snmp_select_info(&numfds, &fdset, &timeout, &block);
count = select(numfds, &fdset, NULL, NULL, block ? NULL : &timeout);

since it isn't obvious from your code that you have something that
should happen after 5 seconds.
                
>                       .......

Does something of consequence happen in the ...'s?

> if (0 < count){
>     snmp_read(&fdset);
> } else {
>     switch(count){
>     case 0:
>         snmp_timeout();
>         break;
>     case -1:
>         if (EINTR == errno)
>             continue;
>         trap_signal_trap_listener_shutdown();
>         break;
>     default:
>         ntap_log(LOG_ERR, "select returned %d.", count);
>         trap_signal_trap_listener_shutdown();
>     }
> }
> 
> Is there anything wrong with the arguments passed to snmp_select_info
> w.r.t ipv6 address?

The arguments look reasonable except that you are clamping the sleep
time to 5 seconds.

/MF


------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to