Browse code

- fix: blacklist timer would could enter and infinite loop, after ~1 h, due to an overflowing unsigned short var

Andrei Pelinescu-Onciul authored on 05/06/2007 13:52:13
Showing 1 changed files
... ...
@@ -453,8 +453,8 @@ inline static int dst_blacklist_clean_expired(unsigned int target,
453 453
 									  ticks_t delta,
454 454
 									  ticks_t timeout)
455 455
 {
456
-	static unsigned short start=0;
457
-	unsigned short h;
456
+	static unsigned int start=0;
457
+	unsigned int h;
458 458
 	struct dst_blst_entry** crt;
459 459
 	struct dst_blst_entry** tmp;
460 460
 	struct dst_blst_entry* e;
... ...
@@ -464,7 +464,7 @@ inline static int dst_blacklist_clean_expired(unsigned int target,
464 464
 	int i;
465 465
 	
466 466
 	now=start_time=get_ticks_raw();
467
-	for(h=start; h!=(start+(unsigned short)DST_BLST_HASH_SIZE); h++){
467
+	for(h=start; h!=(start+DST_BLST_HASH_SIZE); h++){
468 468
 		i=h%DST_BLST_HASH_SIZE;
469 469
 		if (dst_blst_hash[i].first){
470 470
 			LOCK_BLST(i);