From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amin Azez Subject: BUG: More ipt_recent queries Date: Tue, 21 Feb 2006 11:16:34 +0000 Message-ID: <43FAF692.8030804@ufomechanic.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: To: netfilter-devel@lists.netfilter.org In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-devel-bounces@lists.netfilter.org Errors-To: netfilter-devel-bounces@lists.netfilter.org List-Id: netfilter-devel.vger.kernel.org I'm concerned about ipt_recent where it removes entries from the list. Surly the move-up-and-close-the-gap while loop will never enter because time_info[time_loc].time has just been set to 0 so that this clause of the while loop: time_info[(time_loc+1) % ip_list_tot].time < time_info[time_loc].time) will always be false. Fuller code segment: location = hash_table[hash_result]; hash_table[r_list[location].hash_entry] = -1; time_loc = r_list[location].time_pos; time_info[time_loc].time = 0; time_info[time_loc].position = location; while((time_info[(time_loc+1) % ip_list_tot].time < time_info[time_loc].time) && ((time_loc+1) % ip_list_tot) != curr_table->time_pos) { time_temp = time_info[time_loc].time; time_info[time_loc].time = time_info[(time_loc+1)%ip_list_tot].time; time_info[(time_loc+1)%ip_list_tot].time = time_temp; time_temp = time_info[time_loc].position; time_info[time_loc].position = time_info[(time_loc+1)%ip_list_tot].position; time_info[(time_loc+1)%ip_list_tot].position = time_temp; r_list[time_info[time_loc].position].time_pos = time_loc; r_list[time_info[(time_loc+1)%ip_list_tot].position].time_pos = (time_loc+1)%ip_list_tot; time_loc = (time_loc+1) % ip_list_tot; } I think we should set time_info[time_loc].time = 0; at the end of the while loop? Sam