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

suspicious code in cls_u32.c



static u32 gen_new_htid(struct tc_u_common *tp_c)
{
        int i = 0x800;
 
        do {
                if (++tp_c->hgenerator == 0x7FF)
                        tp_c->hgenerator = 1;
        } while (i>0 && u32_lookup_ht(tp_c, (tp_c->hgenerator|0x800)<<20));
 
        return i > 0 ? (tp_c->hgenerator|0x800)<<20 : 0;
}                                                                             


Shouldn't "i" be decremented somewhere? Otherwise it will always be 0x800, 
thus > 0.

BTW, why must these IDs have the MSbit set (i.e., >= 0x800)?

  
-- 
Rui Prior

--------------------------------------------------
 /"\
 \ / 
  X  ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 / \
--------------------------------------------------