diff mbox

[nf-next,v2] ipvs: use nf_ct_kill helper

Message ID 1470230488-302-1-git-send-email-fw@strlen.de
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Florian Westphal Aug. 3, 2016, 1:21 p.m. UTC
Once timer is removed from nf_conn struct we cannot open-code
the removal sequence anymore.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 V2: keep debug messages around.

 net/netfilter/ipvs/ip_vs_nfct.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Julian Anastasov Aug. 3, 2016, 6:37 p.m. UTC | #1
Hello,

On Wed, 3 Aug 2016, Florian Westphal wrote:

> Once timer is removed from nf_conn struct we cannot open-code
> the removal sequence anymore.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>

	Looks good to me,

Acked-by: Julian Anastasov <ja@ssi.bg>

> ---
>  V2: keep debug messages around.
> 
>  net/netfilter/ipvs/ip_vs_nfct.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/net/netfilter/ipvs/ip_vs_nfct.c b/net/netfilter/ipvs/ip_vs_nfct.c
> index f04fd8d..fc230d9 100644
> --- a/net/netfilter/ipvs/ip_vs_nfct.c
> +++ b/net/netfilter/ipvs/ip_vs_nfct.c
> @@ -281,13 +281,10 @@ 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="
> +		if (nf_ct_kill(ct)) {
> +			IP_VS_DBG(7, "%s: ct=%p, deleted conntrack 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",
> -- 
> 2.7.3

Regards

--
Julian Anastasov <ja@ssi.bg>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pablo Neira Ayuso Aug. 12, 2016, 10:24 a.m. UTC | #2
On Wed, Aug 03, 2016 at 03:21:28PM +0200, Florian Westphal wrote:
> Once timer is removed from nf_conn struct we cannot open-code
> the removal sequence anymore.

@Simon and other IPVS folks: I'm going to take this patch since
Florian needs this merged for follow up patches.

So I'm dealing with this small one.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman Aug. 12, 2016, 11:21 a.m. UTC | #3
Hi Pablo,

On Fri, Aug 12, 2016 at 12:24:43PM +0200, Pablo Neira Ayuso wrote:
> On Wed, Aug 03, 2016 at 03:21:28PM +0200, Florian Westphal wrote:
> > Once timer is removed from nf_conn struct we cannot open-code
> > the removal sequence anymore.
> 
> @Simon and other IPVS folks: I'm going to take this patch since
> Florian needs this merged for follow up patches.
> 
> So I'm dealing with this small one.

Sure, please do.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/netfilter/ipvs/ip_vs_nfct.c b/net/netfilter/ipvs/ip_vs_nfct.c
index f04fd8d..fc230d9 100644
--- a/net/netfilter/ipvs/ip_vs_nfct.c
+++ b/net/netfilter/ipvs/ip_vs_nfct.c
@@ -281,13 +281,10 @@  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="
+		if (nf_ct_kill(ct)) {
+			IP_VS_DBG(7, "%s: ct=%p, deleted conntrack 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",