[Xorp-cvs] XORP cvs commit: xorp/libxorp

Pavlin Radoslavov pavlin at icir.org
Sun Nov 2 12:38:09 PST 2008


CVSROOT:	/usr/local/www/data/cvs
Module name:	xorp
Changes by:	pavlin at chum.icir.org	2008-11-02 20:38:09 UTC

XORP CVS repository


Modified files:
	libxorp       selector.cc 

Log message:
	Serious bug fix in the storage of the selector masks
	inside SelectorList::Node::add_okay().
	
	There are arrays like _priority[SEL_MAX_IDX], _cb[SEL_MAX_IDX],
	_iot[SEL_MAX_IDX] and _mask[SEL_MAX_IDX] which are used
	for storing event registration information per file descriptor:
	priority, callback, I/O event type, and SelectorMask.
	In some parts of the Selector code there is the assumption that
	array index SEL_RD_IDX is used for storing information related
	to READ I/O registration, SEL_WR_IDX is used for storing information
	related to WRITE I/O, and so on.
	
	However, inside SelectorList::Node::add_okay() Step 2, the original
	code selected the first _empty_ bin to store the information which
	seems inconsistent with the above-mentioned assumption.
	
	After the fix, READ I/O registration goes into [SEL_RD_IDX],
	WRITE I/O registration goes into [SEL_WR_IDX], and so on.
	The rest of the Selector code is not modified: it still looks
	for various masks in all array bins which is sub-optimal.
	
	A side note: internally, we don't need the concept of
	SelectorMask, because outside of the EventLoop we can
	register only for a particular event type: IOT_READ, IOT_WRITE, etc.
	The only exception is IOT_ANY, and that one is used only
	when remove_ioevent_cb() is called to remove all callbacks for
	a file descriptor.
	If SelectorMask is removed, this will simplify the implementation,
	and will speed-up the eventloop processing.
	
	This fixes the remaining issue in Bugzilla entry #800
	
	Bugzilla URL:   http://bugzilla.xorp.org/bugzilla/show_bug.cgi?id=800
	Approved by:    Atanu Ghosh

Revision  Changes                                 Path
1.54      +30 -13;  commitid: 12503490e0b6241a7;  xorp/libxorp/selector.cc



More information about the Xorp-cvs mailing list