On Mon, Apr 20, 2009 at 12:30 PM, Dave Shield
<[email protected]> wrote:
> 2009/4/18 Bart Van Assche <[email protected]>:
>> Apparently the patch with ID 1627049
>> (http://sourceforge.net/tracker/index.php?func=detail&aid=1627049&group_id=12694&atid=312694)
>> has been applied on the 5.5pre branch. Please revert this patch --
>> this patch not only causes portability problems but IMHO it's the
>> wrong way to fix the observed problem (crash on Linux with a file or
>> socket descriptor >= FD_SETSIZE).
>
> OK - I've reverted that patch, and applied a simpler one to deal
> with the immediate problem.  (i.e. skip any fd's that are too large
> to be handled by fd_set, etc).
>
> A better solution to handling large fd's will probably need to wait until 5.6.
> (Although perhaps we could start looking at this reasonably soon - the
> offending patch has been in place since early 2007, so it's a little
> disappointing that these issues weren't picked up earlier, in time to
> deal with them for the 5.5 release)

I was considering to prepare a patch that does the following:
* Adds source files netsnmp_select.h and netsnmp_select.cpp.
* Adds a new data structure netsnmp_fd_set, which consists of a
structure similar to fd_set and an integer variable that represents
the allocated size.
* Functions for allocating and deallocating a netsnmp_fd_set structure.
* New macro's NETSNMP_FD_SET etc. that operate on netsnmp_fd_set and
perform range checking such that these cannot trigger memory
corruption.

The above should make it relatively easy to add a new function
snmp_select_info2() that fills in a netsnmp_fd_set structure instead
of an fd_set, and to convert the callers of snmp_select_info() in
snmplib to call snmp_select_info2() instead.

If I understood the above correctly such a patch should wait until version 5.6 ?

Bart.

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to