On Jun 25 2007 15:53, Patrick McHardy wrote: >Vasily Averin wrote: >> +static int early_drop(const struct nf_conntrack_tuple *orig) >> +{ >> + unsigned int i, hash, cnt; >> + int ret = 0; >> + >> + hash = hash_conntrack(orig); >> + cnt = NF_CT_PER_BUCKET; >> + >> + for (i = 0; >> + !ret && cnt && i < nf_conntrack_htable_size; >> + ++i, hash = ++hash % nf_conntrack_htable_size) >> + ret = __early_drop(&nf_conntrack_hash[hash], &cnt); > >Formatting is a bit ugly, looks much nicer as: > > for (i = 0; i < nf_conntrack_htable_size; i++) { > > ret = __early_drop(&nf_conntrack_hash[hash], &cnt); > if (ret || !cnt) > break; > hash = ++hash % nf_conntrack_htable_size; > } gcc warning: operation on ‘hash’ may be undefined Jan --
- References:
- [PATCH 2.6.21-rc6] [netfilter] early_drop imrovement
- From: Vasily Averin <[email protected]>
- Re: [PATCH 2.6.21-rc6] [netfilter] early_drop imrovement
- From: Eric Dumazet <[email protected]>
- Re: [PATCH 2.6.21-rc6] [netfilter] early_drop imrovement
- From: Vasily Averin <[email protected]>
- Re: [PATCH 2.6.21-rc6] [netfilter] early_drop imrovement
- From: Patrick McHardy <[email protected]>
- [PATCH nf-2.6.22] [netfilter] early_drop imrovement
- From: Vasily Averin <[email protected]>
- Re: [PATCH nf-2.6.22] [netfilter] early_drop imrovement
- From: Eric Dumazet <[email protected]>
- Re: [PATCH nf-2.6.22] [netfilter] early_drop imrovement
- From: Vasily Averin <[email protected]>
- [NETFILTER] early_drop() imrovement (v3)
- From: Vasily Averin <[email protected]>
- Re: [NETFILTER] early_drop() imrovement (v3)
- From: Patrick McHardy <[email protected]>
- [PATCH 2.6.21-rc6] [netfilter] early_drop imrovement
- Prev by Date: Re: [PATCH][RFC] security: Convert LSM into a static interface
- Next by Date: Re: Is it time for remove (crap) ALSA from kernel tree ?
- Previous by thread: Re: [NETFILTER] early_drop() imrovement (v3)
- Next by thread: Re: [NETFILTER] early_drop() imrovement (v3)
- Index(es):