Hello All,
 
I have an application which uses a large number of sockets, e.g. 10000,
that is also acting as an snmp agent.  If snmpd is restarted, it is
possible that the application's new connection to snmpd uses a file
descriptor >= 1024 - in this case the agent_check_and_process code will
crash due to the fd set size.
 
As a fix, I've patched my version of net-snmp-config.h to allow the
FD_SETSIZE to be re-defined and this seems to work OK.  

Anyway, I just thought I'd let you know.  Perhaps it may be worth adding
this as a configure option, or maybe it would be useful to add an epoll
interface.

Regards, Dominic
 
My change to net-snmp-config.h, define MAX_NUM_FDS to change the
FD_SETSIZE limit:

#ifdef MAX_NUM_FDS
 
#if ( ( __GNUC__ > 3 ) || ( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 4 )
) )
 
#ifdef FD_SETSIZE
 
#  if FD_SETSIZE != MAX_NUM_FDS
#    error "FD_SETSIZE already defined - include net-snmp-config.h
first"
#  endif
 
#else // FD_SETSIZE undefined
 
#  include <bits/types.h>
#  undef __FD_SETSIZE
#  define __FD_SETSIZE MAX_NUM_FDS
#  include <sys/select.h>
 
#  if FD_SETSIZE != MAX_NUM_FDS
#    error "Problem changing max number of FDs - include
net-snmp-config.h first"
#  endif
 
#endif // FD_SETSIZE
 
#else // if GNUC > 3 etc..
#error "Cannot adjust maximum number of FDs on this compiler"
#endif // if GNUC > 3 etc..
 
#endif // MAX_NUM_FDS

 
 

=======================================================================
Homechoice is a trading name of Video Networks Limited of 205 Holland Park 
Avenue, London W11 4XB and registered in England and Wales (No. 2740910).
This email may contain confidential and privileged information and is intended 
for the named or authorised recipients only.  If you are not the named or 
authorised recipient of this email, please note that any copying, distribution, 
disclosure or use of its contents is strictly prohibited.  If you have received 
this email in error please notify the sender immediately and then destroy it. 
The views expressed in this email are not necessarily those held by Video 
Networks Limited and we do not accept any liability for any action taken in 
reliance on the contents of this message.  We do not guarantee that the 
integrity of this email has been maintained, nor that it is free of viruses, 
interceptions or interference.

_______________________________________________________________________
This email has been scanned for all known viruses by the MessageLabs Email 
Security System.
_______________________________________________________________________


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to