Skip to contentSkip to conversation

ipvs: use nf_ct_kill helper

PATCH In review Florian Westphal 4 participants 4 messages Aug 3, 2016 – Aug 12, 2016

Subsystems (3)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH v2 1/1 ipvs: use nf_ct_kill helper

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

---
V2: keep debug messages around.

 net/netfilter/ipvs/ip_vs_nfct.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
net/netfilter/ipvs/ip_vs_nfct.c +2 -5
index f04fd8d..fc230d9 100644
@@ -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",
Signature · 1 line
2.7.3
maintainer Acked-by on v2 1/1
#1 lore raw

Hello,

Quoted 4 lines · Florian Westphal

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

Looks good to me,

Quoted 28 lines

---
V2: keep debug messages around.

 net/netfilter/ipvs/ip_vs_nfct.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
net/netfilter/ipvs/ip_vs_nfct.c +2 -5
index f04fd8d..fc230d9 100644
@@ -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",
Signature · 1 line
2.7.3

Regards

--
Julian Anastasov <[email protected]>

#2 lore raw
In reply to Florian Westphal
Quoted 2 lines · Florian Westphal

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.

maintainer
#3 lore raw

Hi Pablo,

Quoted 8 lines · Pablo Neira Ayuso
Quoted 2 lines · Florian Westphal

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.