All of lore.kernel.org
 help / color / mirror / Atom feed
* [NETFILTER 4/8]: pptp helper: use locked variants of ip_conntrack_find_* functions
@ 2005-09-15 22:44 Patrick McHardy
  0 siblings, 0 replies; only message in thread
From: Patrick McHardy @ 2005-09-15 22:44 UTC (permalink / raw)
  To: Harald Welte; +Cc: Netfilter Development Mailinglist, David S. Miller

[-- Attachment #1: 04.diff --]
[-- Type: text/x-patch, Size: 2563 bytes --]

[NETFILTER]: pptp helper: use locked variants of ip_conntrack_find_* functions

ip_conntrack_lock is not held while the helper is running so it needs
to use the locked variants of __ip_conntrack_expect_find and
__ip_conntrack_find.

Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit f406547e6d2cee9aad722ef4cc48fd14c89ddf08
tree 1c3b6a32ab742bb76b90c8eb5c17529933ec0577
parent 1305f20c8446e6e944924a93eaf90e1896abf788
author Patrick McHardy <kaber@trash.net> Thu, 15 Sep 2005 23:14:31 +0200
committer Patrick McHardy <kaber@trash.net> Thu, 15 Sep 2005 23:14:31 +0200

 net/ipv4/netfilter/ip_conntrack_helper_pptp.c |    7 ++++---
 net/ipv4/netfilter/ip_nat_helper_pptp.c       |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/netfilter/ip_conntrack_helper_pptp.c b/net/ipv4/netfilter/ip_conntrack_helper_pptp.c
--- a/net/ipv4/netfilter/ip_conntrack_helper_pptp.c
+++ b/net/ipv4/netfilter/ip_conntrack_helper_pptp.c
@@ -124,7 +124,7 @@ static void pptp_expectfn(struct ip_conn
 		DEBUGP("trying to unexpect other dir: ");
 		DUMP_TUPLE(&inv_t);
 	
-		exp_other = __ip_conntrack_expect_find(&inv_t);
+		exp_other = ip_conntrack_expect_find(&inv_t);
 		if (exp_other) {
 			/* delete other expectation.  */
 			DEBUGP("found\n");
@@ -147,7 +147,7 @@ static int timeout_ct_or_exp(const struc
 	DEBUGP("trying to timeout ct or exp for tuple ");
 	DUMP_TUPLE(t);
 
-	h = __ip_conntrack_find(t, NULL);
+	h = ip_conntrack_find_get(t, NULL);
 	if (h)  {
 		struct ip_conntrack *sibling = tuplehash_to_ctrack(h);
 		DEBUGP("setting timeout of conntrack %p to 0\n", sibling);
@@ -155,9 +155,10 @@ static int timeout_ct_or_exp(const struc
 		sibling->proto.gre.stream_timeout = 0;
 		/* refresh_acct will not modify counters if skb == NULL */
 		ip_ct_refresh_acct(sibling, 0, NULL, 0);
+		ip_conntrack_put(sibling);
 		return 1;
 	} else {
-		exp = __ip_conntrack_expect_find(t);
+		exp = ip_conntrack_expect_find(t);
 		if (exp) {
 			DEBUGP("unexpect_related of expect %p\n", exp);
 			ip_conntrack_unexpect_related(exp);
diff --git a/net/ipv4/netfilter/ip_nat_helper_pptp.c b/net/ipv4/netfilter/ip_nat_helper_pptp.c
--- a/net/ipv4/netfilter/ip_nat_helper_pptp.c
+++ b/net/ipv4/netfilter/ip_nat_helper_pptp.c
@@ -101,7 +101,7 @@ static void pptp_nat_expected(struct ip_
 
 	DEBUGP("trying to unexpect other dir: ");
 	DUMP_TUPLE(&t);
-	other_exp = __ip_conntrack_expect_find(&t);
+	other_exp = ip_conntrack_expect_find(&t);
 	if (other_exp) {
 		ip_conntrack_unexpect_related(other_exp);
 		ip_conntrack_expect_put(other_exp);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-09-15 22:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-15 22:44 [NETFILTER 4/8]: pptp helper: use locked variants of ip_conntrack_find_* functions Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.