[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Abdelhamid Joumdane: Somethinf missing in classifier-bst.cc



Abdelhamid,

You are absolutely right.  I made the changes to the source code.

Thanks,
Nader

Abdelhamid> Hi all,
Abdelhamid> 
Abdelhamid> I had some problems using BST.tcl and I found out that the
Abdelhamid> problem came from the following function in
Abdelhamid> classifier-bst.cc. 
Abdelhamid> 
Abdelhamid> upstream_info* MCastBSTClassifier::upstream_find(int dst)
Abdelhamid> {
Abdelhamid> 	upstream_info *index;
Abdelhamid> 
Abdelhamid> 	index = oif2RP_;
Abdelhamid> 	while (index) {
Abdelhamid> 		if (index->dst == dst) 
Abdelhamid> 			return index;
Abdelhamid> 	} // while
Abdelhamid> 	return NULL;
Abdelhamid> } // MCastBSTClassifier::upstream_fin
Abdelhamid> 
Abdelhamid> If the "if" test fails it's gonna loop indefinitely. as I
Abdelhamid> saw in the "upstream_info" structure, I thaught it was
Abdelhamid> more likely that the following will be correct :
Abdelhamid> 
Abdelhamid> upstream_info* MCastBSTClassifier::upstream_find(int dst)
Abdelhamid> {
Abdelhamid> 	upstream_info *index;
Abdelhamid> 
Abdelhamid> 	index = oif2RP_;
Abdelhamid> 	while (index) {
Abdelhamid> 		if (index->dst == dst) 
Abdelhamid> 			return index;
Abdelhamid> 		else
Abdelhamid> 			index = index->next ;
Abdelhamid> 	} // while
Abdelhamid> 	return NULL;
Abdelhamid> } // MCastBSTClassifier::upstream_fin
Abdelhamid> 
Abdelhamid> I tested it, and it is working.
Abdelhamid> 
Abdelhamid> Cheers,
Abdelhamid> Abdelhamid JOUMDANE