Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43172
b: refs/heads/master
c: ece0064
h: refs/heads/master
v: v3
  • Loading branch information
Yasuyuki Kozakai authored and David S. Miller committed Dec 7, 2006
1 parent 7f6a4a3 commit 1816bff
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9ee0779e994c6916863045297b831212e285da3b
refs/heads/master: ece006416d4fb472f4d2114feede5665cff971b2
27 changes: 15 additions & 12 deletions trunk/net/netfilter/nf_conntrack_expect.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,28 @@ EXPORT_SYMBOL_GPL(nf_conntrack_expect_find_get);
struct nf_conntrack_expect *
find_expectation(const struct nf_conntrack_tuple *tuple)
{
struct nf_conntrack_expect *i;
struct nf_conntrack_expect *exp;

exp = __nf_conntrack_expect_find(tuple);
if (!exp)
return NULL;

list_for_each_entry(i, &nf_conntrack_expect_list, list) {
/* If master is not in hash table yet (ie. packet hasn't left
this machine yet), how can other end know about expected?
Hence these are not the droids you are looking for (if
master ct never got confirmed, we'd hold a reference to it
and weird things would happen to future packets). */
if (nf_ct_tuple_mask_cmp(tuple, &i->tuple, &i->mask)
&& nf_ct_is_confirmed(i->master)) {
if (i->flags & NF_CT_EXPECT_PERMANENT) {
atomic_inc(&i->use);
return i;
} else if (del_timer(&i->timeout)) {
nf_ct_unlink_expect(i);
return i;
}
}
if (!nf_ct_is_confirmed(exp->master))
return NULL;

if (exp->flags & NF_CT_EXPECT_PERMANENT) {
atomic_inc(&exp->use);
return exp;
} else if (del_timer(&exp->timeout)) {
nf_ct_unlink_expect(exp);
return exp;
}

return NULL;
}

Expand Down

0 comments on commit 1816bff

Please sign in to comment.