Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7552
b: refs/heads/master
c: 49719eb
h: refs/heads/master
v: v3
  • Loading branch information
Pablo Neira Ayuso authored and David S. Miller committed Sep 6, 2005
1 parent 3a74a2c commit f5f311f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 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: 91c46e2e60da0b43a1e8740729737318862f64eb
refs/heads/master: 49719eb355d32fa07793017b4b46b1c02e88b275
2 changes: 1 addition & 1 deletion trunk/include/linux/netfilter_ipv4/ip_conntrack_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static inline int ip_conntrack_confirm(struct sk_buff **pskb)
return ret;
}

extern void __ip_ct_expect_unlink_destroy(struct ip_conntrack_expect *exp);
extern void ip_ct_unlink_expect(struct ip_conntrack_expect *exp);

extern struct list_head *ip_conntrack_hash;
extern struct list_head ip_conntrack_expect_list;
Expand Down
20 changes: 7 additions & 13 deletions trunk/net/ipv4/netfilter/ip_conntrack_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ ip_ct_invert_tuple(struct ip_conntrack_tuple *inverse,


/* ip_conntrack_expect helper functions */
static void unlink_expect(struct ip_conntrack_expect *exp)
void ip_ct_unlink_expect(struct ip_conntrack_expect *exp)
{
ASSERT_WRITE_LOCK(&ip_conntrack_lock);
IP_NF_ASSERT(!timer_pending(&exp->timeout));
Expand All @@ -207,18 +207,12 @@ static void unlink_expect(struct ip_conntrack_expect *exp)
ip_conntrack_expect_put(exp);
}

void __ip_ct_expect_unlink_destroy(struct ip_conntrack_expect *exp)
{
unlink_expect(exp);
ip_conntrack_expect_put(exp);
}

static void expectation_timed_out(unsigned long ul_expect)
{
struct ip_conntrack_expect *exp = (void *)ul_expect;

write_lock_bh(&ip_conntrack_lock);
unlink_expect(exp);
ip_ct_unlink_expect(exp);
write_unlock_bh(&ip_conntrack_lock);
ip_conntrack_expect_put(exp);
}
Expand Down Expand Up @@ -269,7 +263,7 @@ find_expectation(const struct ip_conntrack_tuple *tuple)
atomic_inc(&i->use);
return i;
} else if (del_timer(&i->timeout)) {
unlink_expect(i);
ip_ct_unlink_expect(i);
return i;
}
}
Expand All @@ -288,7 +282,7 @@ void ip_ct_remove_expectations(struct ip_conntrack *ct)

list_for_each_entry_safe(i, tmp, &ip_conntrack_expect_list, list) {
if (i->master == ct && del_timer(&i->timeout)) {
unlink_expect(i);
ip_ct_unlink_expect(i);
ip_conntrack_expect_put(i);
}
}
Expand Down Expand Up @@ -929,7 +923,7 @@ void ip_conntrack_unexpect_related(struct ip_conntrack_expect *exp)
/* choose the the oldest expectation to evict */
list_for_each_entry_reverse(i, &ip_conntrack_expect_list, list) {
if (expect_matches(i, exp) && del_timer(&i->timeout)) {
unlink_expect(i);
ip_ct_unlink_expect(i);
write_unlock_bh(&ip_conntrack_lock);
ip_conntrack_expect_put(i);
return;
Expand Down Expand Up @@ -986,7 +980,7 @@ static void evict_oldest_expect(struct ip_conntrack *master)
list_for_each_entry_reverse(i, &ip_conntrack_expect_list, list) {
if (i->master == master) {
if (del_timer(&i->timeout)) {
unlink_expect(i);
ip_ct_unlink_expect(i);
ip_conntrack_expect_put(i);
}
break;
Expand Down Expand Up @@ -1103,7 +1097,7 @@ void ip_conntrack_helper_unregister(struct ip_conntrack_helper *me)
/* Get rid of expectations */
list_for_each_entry_safe(exp, tmp, &ip_conntrack_expect_list, list) {
if (exp->master->helper == me && del_timer(&exp->timeout)) {
unlink_expect(exp);
ip_ct_unlink_expect(exp);
ip_conntrack_expect_put(exp);
}
}
Expand Down
12 changes: 8 additions & 4 deletions trunk/net/ipv4/netfilter/ip_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,17 +1349,21 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb,
list_for_each_entry_safe(exp, tmp, &ip_conntrack_expect_list,
list) {
if (exp->master->helper == h
&& del_timer(&exp->timeout))
__ip_ct_expect_unlink_destroy(exp);
&& del_timer(&exp->timeout)) {
ip_ct_unlink_expect(exp);
ip_conntrack_expect_put(exp);
}
}
write_unlock(&ip_conntrack_lock);
} else {
/* This basically means we have to flush everything*/
write_lock_bh(&ip_conntrack_lock);
list_for_each_entry_safe(exp, tmp, &ip_conntrack_expect_list,
list) {
if (del_timer(&exp->timeout))
__ip_ct_expect_unlink_destroy(exp);
if (del_timer(&exp->timeout)) {
ip_ct_unlink_expect(exp);
ip_conntrack_expect_put(exp);
}
}
write_unlock_bh(&ip_conntrack_lock);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/netfilter/ip_conntrack_standalone.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ EXPORT_SYMBOL(ip_conntrack_expect_related);
EXPORT_SYMBOL(ip_conntrack_unexpect_related);
EXPORT_SYMBOL_GPL(ip_conntrack_expect_list);
EXPORT_SYMBOL_GPL(__ip_conntrack_expect_find);
EXPORT_SYMBOL_GPL(__ip_ct_expect_unlink_destroy);
EXPORT_SYMBOL_GPL(ip_ct_unlink_expect);

EXPORT_SYMBOL(ip_conntrack_tuple_taken);
EXPORT_SYMBOL(ip_ct_gather_frags);
Expand Down

0 comments on commit f5f311f

Please sign in to comment.