Skip to contentSkip to conversation

netfilter: ipvs: fix incorrect conflict resolution

PATCH In review Florian Westphal 2 participants 2 messages Apr 18, 2017 – Apr 19, 2017

Subsystems (3)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: ipvs: fix incorrect conflict resolution

The commit ab8bc7ed864b9c4f1fcb00a22bbe4e0f66ce8003 ("netfilter: remove nf_ct_is_untracked") changed the line
if (ct && !nf_ct_is_untracked(ct) && nfct_nat(ct)) {
to
if (ct && nfct_nat(ct)) {

meanwhile, the commit 41390895e50bc4f28abe384c6b35ac27464a20ec ("netfilter: ipvs: don't check for presence of nat extension") from ipvs-next had changed the same line to

  if (ct && !nf_ct_is_untracked(ct) && (ct->status & IPS_NAT_MASK)) {

When ipvs-next got merged into nf-next, the merge resolution took the first version, dropping the conversion of nfct_nat().

While this doesn't cause a problem at the moment, it will once we stop adding the nat extension by default.

---
Pablo, I prefer if this can go via nf-next rather than ipvs-next.

net/netfilter/ipvs/ip_vs_ftp.c +2 -1
index af3a9bbdf2ae..fb780be76d15 100644
@@ -260,8 +260,9 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
 		buf_len = strlen(buf);
 
 		ct = nf_ct_get(skb, &ctinfo);
-		if (ct && nfct_nat(ct)) {
+		if (ct && (ct->status & IPS_NAT_MASK)) {
 			bool mangled;
+
 			/* If mangling fails this function will return 0
 			 * which will cause the packet to be dropped.
 			 * Mangling can only fail under memory pressure,
Signature · 1 line
2.10.2
#1 lore raw
Quoted 11 lines · Florian Westphal

The commit ab8bc7ed864b9c4f1fcb00a22bbe4e0f66ce8003 ("netfilter: remove nf_ct_is_untracked") changed the line
if (ct && !nf_ct_is_untracked(ct) && nfct_nat(ct)) {
to
if (ct && nfct_nat(ct)) {

meanwhile, the commit 41390895e50bc4f28abe384c6b35ac27464a20ec ("netfilter: ipvs: don't check for presence of nat extension") from ipvs-next had changed the same line to

Quoted 7 lines
  if (ct && !nf_ct_is_untracked(ct) && (ct->status & IPS_NAT_MASK)) {

When ipvs-next got merged into nf-next, the merge resolution took the first version, dropping the conversion of nfct_nat().

While this doesn't cause a problem at the moment, it will once we stop adding the nat extension by default.

Also applied, thanks.