Skip to contentSkip to conversation

netfilter: helper: Fix helper unregister count.

PATCH Applied Taehee Yoo 2 participants 6 messages May 14, 2016 – May 30, 2016 4 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Taehee Yoo

author
#0 lore raw

PATCH 2/2 netfilter: helper: Fix helper unregister count.

helpers should unregister the only registered ports. but, helper cannot have correct registered ports value when failed to register.

---
 net/netfilter/nf_conntrack_ftp.c  | 1 +
 net/netfilter/nf_conntrack_irc.c  | 1 +
 net/netfilter/nf_conntrack_sane.c | 1 +
 net/netfilter/nf_conntrack_sip.c  | 1 +
 net/netfilter/nf_conntrack_tftp.c | 1 +
 5 files changed, 5 insertions(+)
net/netfilter/nf_conntrack_ftp.c +1 -0
index 883c691..19efeba 100644
@@ -632,6 +632,7 @@ static int __init nf_conntrack_ftp_init(void)
 			if (ret) {
 				pr_err("failed to register helper for pf: %d port: %d\n",
 				       ftp[i][j].tuple.src.l3num, ports[i]);
+				ports_c = i;
 				nf_conntrack_ftp_fini();
 				return ret;
 			}
net/netfilter/nf_conntrack_irc.c +1 -0
index 20ae74f..9844e62 100644
@@ -271,6 +271,7 @@ static int __init nf_conntrack_irc_init(void)
 		if (ret) {
 			pr_err("failed to register helper for pf: %u port: %u\n",
 			       irc[i].tuple.src.l3num, ports[i]);
+			ports_c = i;
 			nf_conntrack_irc_fini();
 			return ret;
 		}
net/netfilter/nf_conntrack_sane.c +1 -0
index 7523a57..3fcbaab 100644
@@ -223,6 +223,7 @@ static int __init nf_conntrack_sane_init(void)
 			if (ret) {
 				pr_err("failed to register helper for pf: %d port: %d\n",
 				       sane[i][j].tuple.src.l3num, ports[i]);
+				ports_c = i;
 				nf_conntrack_sane_fini();
 				return ret;
 			}
net/netfilter/nf_conntrack_sip.c +1 -0
index d523052..2c748bc 100644
@@ -1669,6 +1669,7 @@ static int __init nf_conntrack_sip_init(void)
 			if (ret) {
 				pr_err("failed to register helper for pf: %u port: %u\n",
 				       sip[i][j].tuple.src.l3num, ports[i]);
+				ports_c = i;
 				nf_conntrack_sip_fini();
 				return ret;
 			}
net/netfilter/nf_conntrack_tftp.c +1 -0
index 47239fb..6d9c441 100644
@@ -142,6 +142,7 @@ static int __init nf_conntrack_tftp_init(void)
 			if (ret) {
 				pr_err("failed to register helper for pf: %u port: %u\n",
 				       tftp[i][j].tuple.src.l3num, ports[i]);
+				ports_c = i;
 				nf_conntrack_tftp_fini();
 				return ret;
 			}
Signature · 1 line
2.7.4

A message that is not in the archive (sent off-list or not yet received): CA+6hz4pj-wp5Vye6GSxiZM1-Bfq=qcJCUJD0hjEbmmtRsTfhow@mail.gmail.com

#2 lore raw
Quoted 9 lines · Feng Gao

Hi,

I have committed the patches. see the following links
http://patchwork.ozlabs.org/patch/565169/
http://patchwork.ozlabs.org/patch/565170/
http://patchwork.ozlabs.org/patch/565171/

But i don't know why they are not accepted yet.
I have did all advises of Pablo.

I prefer to take these small patch fixes from Taehee Yoo, so I can pass back this to -stable. Once they are applied, I'd suggest you rebase your large rework to introduce these new helper functions to register conntrack helpers.

Thanks.

A message that is not in the archive (sent off-list or not yet received): CA+6hz4qEt7CMCuTAf+8ik2LGUJ7SLVuSkkd8VCbgvL4MehEsWQ@mail.gmail.com

#4 lore raw
Quoted 6 lines · Feng Gao

Hi Pablo,

I remember my original commit is very simple.
Just a few lines changes.

Then I make it more complicated according to your comments

Are you refering to this?

http://patchwork.ozlabs.org/patch/522709/

I suggested this specifically: "Could you investigate if it would be possible to add a nf_conntrack_helpers_register()?"

Then, you followed up with a patchset that was fixing and reworking in the same go.

The usual procedure is to split the submissions in logical changes, starting from fixes (that are always prioritized) and then follow up with rework/improvements/new features.

I also remember that at some point you withdrew indicating that there was a problem, then came back telling this was OK, which confused me.

A message that is not in the archive (sent off-list or not yet received): CA+6hz4pHweCqvTU0UhiKHcCg=kYAj0z1t1Ow26u3njDxPHXsgg@mail.gmail.com

#6 lore raw
Quoted 6 lines · Feng Gao

yes.

It was my fault at that time.
I thought there may be one problem that I forget test, so I just to notify you.
I was afraid that it would break the work.

That's a valid concern, and I appreciate you indicated this. But then, it's better if you resubmit and include in the description what you did to test it.

Quoted 3 lines

But I found i had tested that case after a while, it would not be wrong. Because that was my first commit to the netfilter, i don't want to break it. So i was too upset.

Don't get upset, it can be a bit frustrating to understand the whole process in the beginning, and keep re-submitting if you think you're doing the right thing.

Another note: I also remember you also posted patches out of the "merge window". Netfilter sticks to David Miller's net-next merge window, which is now closed BTW. Merge window (not strictly this, but an approximation) opens by when -rc1 is released and then it closes by when the first mainline kernel version is released.

Thanks.

A message that is not in the archive (sent off-list or not yet received): CA+6hz4reMcuYk=x5ouJbgb=YogR9ycnoySEDy2XuSiGZj7CDPg@mail.gmail.com

#8 lore raw
Quoted 5 lines · Feng Gao

Hi Pablo,

Then could you give me some tips that how could i should to do next? Rebase the codes, and resubmit the commit about register helpers? Or Give up this and try to other commits?

Let's get the fixes in the tree first. Then, I'd suggest you follow up with your patches once the fixes show up in nf-next.

maintainer Applied
#9 lore raw
In reply to Taehee Yoo
Quoted 3 lines · Taehee Yoo

helpers should unregister the only registered ports. but, helper cannot have correct registered ports value when failed to register.

Applied, thanks.