Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90339
b: refs/heads/master
c: 359b9ab
h: refs/heads/master
i:
  90337: aa26331
  90335: e86092c
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Mar 26, 2008
1 parent 1136ff2 commit e3f2ae3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 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: 4bb119eab7b724109d8eeb0f8d86ed1e4953d338
refs/heads/master: 359b9ab614aba71c2c3bc047efbd6d12dd4a2b9e
3 changes: 2 additions & 1 deletion trunk/include/net/netfilter/nf_conntrack_expect.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ struct nf_conntrack_expect
struct rcu_head rcu;
};

#define NF_CT_EXPECT_PERMANENT 0x1
#define NF_CT_EXPECT_PERMANENT 0x1
#define NF_CT_EXPECT_INACTIVE 0x2

int nf_conntrack_expect_init(void);
void nf_conntrack_expect_fini(void);
Expand Down
25 changes: 21 additions & 4 deletions trunk/net/netfilter/nf_conntrack_expect.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,21 @@ EXPORT_SYMBOL_GPL(nf_ct_expect_find_get);
struct nf_conntrack_expect *
nf_ct_find_expectation(const struct nf_conntrack_tuple *tuple)
{
struct nf_conntrack_expect *exp;
struct nf_conntrack_expect *i, *exp = NULL;
struct hlist_node *n;
unsigned int h;

if (!nf_ct_expect_count)
return NULL;

exp = __nf_ct_expect_find(tuple);
h = nf_ct_expect_dst_hash(tuple);
hlist_for_each_entry(i, n, &nf_ct_expect_hash[h], hnode) {
if (!(i->flags & NF_CT_EXPECT_INACTIVE) &&
nf_ct_tuple_mask_cmp(tuple, &i->tuple, &i->mask)) {
exp = i;
break;
}
}
if (!exp)
return NULL;

Expand Down Expand Up @@ -460,6 +472,7 @@ static int exp_seq_show(struct seq_file *s, void *v)
{
struct nf_conntrack_expect *expect;
struct hlist_node *n = v;
char *delim = "";

expect = hlist_entry(n, struct nf_conntrack_expect, hnode);

Expand All @@ -476,8 +489,12 @@ static int exp_seq_show(struct seq_file *s, void *v)
__nf_ct_l4proto_find(expect->tuple.src.l3num,
expect->tuple.dst.protonum));

if (expect->flags & NF_CT_EXPECT_PERMANENT)
seq_printf(s, "PERMANENT ");
if (expect->flags & NF_CT_EXPECT_PERMANENT) {
seq_printf(s, "PERMANENT");
delim = ",";
}
if (expect->flags & NF_CT_EXPECT_INACTIVE)
seq_printf(s, "%sINACTIVE", delim);

return seq_putc(s, '\n');
}
Expand Down

0 comments on commit e3f2ae3

Please sign in to comment.