All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nf-next] ipvs: use nf_ct_kill helper
@ 2016-08-03  0:51 ` Florian Westphal
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Westphal @ 2016-08-03  0:51 UTC (permalink / raw)
  To: netfilter-devel; +Cc: lvs-devel, Florian Westphal

Once timer is removed from nf_conn struct we cannot open-code
the removal sequence like this anymore.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 ipvs maintainers:

 Alternatively I can do a 1:1 replacement of the del_timer() with a
 test_and_set_bit().

 Please let me know if you would prefer this,

diff --git a/net/netfilter/ipvs/ip_vs_nfct.c b/net/netfilter/ipvs/ip_vs_nfct.c
index f04fd8d..69ce16e 100644
--- a/net/netfilter/ipvs/ip_vs_nfct.c
+++ b/net/netfilter/ipvs/ip_vs_nfct.c
@@ -281,18 +281,7 @@ void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp)
 	h = nf_conntrack_find_get(cp->ipvs->net, &nf_ct_zone_dflt, &tuple);
 	if (h) {
 		ct = nf_ct_tuplehash_to_ctrack(h);
-		/* Show what happens instead of calling nf_ct_kill() */
-		if (del_timer(&ct->timeout)) {
-			IP_VS_DBG(7, "%s: ct=%p, deleted conntrack timer for tuple="
-				FMT_TUPLE "\n",
-				__func__, ct, ARG_TUPLE(&tuple));
-			if (ct->timeout.function)
-				ct->timeout.function(ct->timeout.data);
-		} else {
-			IP_VS_DBG(7, "%s: ct=%p, no conntrack timer for tuple="
-				FMT_TUPLE "\n",
-				__func__, ct, ARG_TUPLE(&tuple));
-		}
+		nf_ct_kill(ct);
 		nf_ct_put(ct);
 	} else {
 		IP_VS_DBG(7, "%s: no conntrack for tuple=" FMT_TUPLE "\n",
-- 
2.7.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH nf-next] ipvs: use nf_ct_kill helper
@ 2016-08-03  0:51 ` Florian Westphal
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Westphal @ 2016-08-03  0:51 UTC (permalink / raw)
  To: netfilter-devel; +Cc: lvs-devel, Florian Westphal

Once timer is removed from nf_conn struct we cannot open-code
the removal sequence like this anymore.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 ipvs maintainers:

 Alternatively I can do a 1:1 replacement of the del_timer() with a
 test_and_set_bit().

 Please let me know if you would prefer this,

diff --git a/net/netfilter/ipvs/ip_vs_nfct.c b/net/netfilter/ipvs/ip_vs_nfct.c
index f04fd8d..69ce16e 100644
--- a/net/netfilter/ipvs/ip_vs_nfct.c
+++ b/net/netfilter/ipvs/ip_vs_nfct.c
@@ -281,18 +281,7 @@ void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp)
 	h = nf_conntrack_find_get(cp->ipvs->net, &nf_ct_zone_dflt, &tuple);
 	if (h) {
 		ct = nf_ct_tuplehash_to_ctrack(h);
-		/* Show what happens instead of calling nf_ct_kill() */
-		if (del_timer(&ct->timeout)) {
-			IP_VS_DBG(7, "%s: ct=%p, deleted conntrack timer for tuple="
-				FMT_TUPLE "\n",
-				__func__, ct, ARG_TUPLE(&tuple));
-			if (ct->timeout.function)
-				ct->timeout.function(ct->timeout.data);
-		} else {
-			IP_VS_DBG(7, "%s: ct=%p, no conntrack timer for tuple="
-				FMT_TUPLE "\n",
-				__func__, ct, ARG_TUPLE(&tuple));
-		}
+		nf_ct_kill(ct);
 		nf_ct_put(ct);
 	} else {
 		IP_VS_DBG(7, "%s: no conntrack for tuple=" FMT_TUPLE "\n",
-- 
2.7.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH nf-next] ipvs: use nf_ct_kill helper
  2016-08-03  0:51 ` Florian Westphal
  (?)
@ 2016-08-03  7:37 ` Julian Anastasov
  -1 siblings, 0 replies; 3+ messages in thread
From: Julian Anastasov @ 2016-08-03  7:37 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel, lvs-devel


	Hello,

On Wed, 3 Aug 2016, Florian Westphal wrote:

> Once timer is removed from nf_conn struct we cannot open-code
> the removal sequence like this anymore.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
>  ipvs maintainers:
> 
>  Alternatively I can do a 1:1 replacement of the del_timer() with a
>  test_and_set_bit().
> 
>  Please let me know if you would prefer this,
> 
> diff --git a/net/netfilter/ipvs/ip_vs_nfct.c b/net/netfilter/ipvs/ip_vs_nfct.c
> index f04fd8d..69ce16e 100644
> --- a/net/netfilter/ipvs/ip_vs_nfct.c
> +++ b/net/netfilter/ipvs/ip_vs_nfct.c
> @@ -281,18 +281,7 @@ void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp)
>  	h = nf_conntrack_find_get(cp->ipvs->net, &nf_ct_zone_dflt, &tuple);
>  	if (h) {
>  		ct = nf_ct_tuplehash_to_ctrack(h);
> -		/* Show what happens instead of calling nf_ct_kill() */
> -		if (del_timer(&ct->timeout)) {

	May be it would be better to preserve the debug
messages, i.e. if we replace del_timer with nf_ct_kill and
remove the ct->timeout.function call below. I assume nf_ct_kill
still returns such bool result. Then the debug messages should
not be affected, I think.

> -			IP_VS_DBG(7, "%s: ct=%p, deleted conntrack timer for tuple="
> -				FMT_TUPLE "\n",
> -				__func__, ct, ARG_TUPLE(&tuple));
> -			if (ct->timeout.function)
> -				ct->timeout.function(ct->timeout.data);
> -		} else {
> -			IP_VS_DBG(7, "%s: ct=%p, no conntrack timer for tuple="
> -				FMT_TUPLE "\n",
> -				__func__, ct, ARG_TUPLE(&tuple));
> -		}
> +		nf_ct_kill(ct);
>  		nf_ct_put(ct);
>  	} else {
>  		IP_VS_DBG(7, "%s: no conntrack for tuple=" FMT_TUPLE "\n",
> -- 
> 2.7.3

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-03  7:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-03  0:51 [PATCH nf-next] ipvs: use nf_ct_kill helper Florian Westphal
2016-08-03  0:51 ` Florian Westphal
2016-08-03  7:37 ` Julian Anastasov

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.