Skip to contentSkip to conversation

ipvs: fix matching of fwmark templates during scheduling

PATCH In review Julian Anastasov 2 participants 2 messages Jan 26, 2012 – Jan 27, 2012

Subsystems (3)
lore
Share & tools
lore

Julian Anastasov

author maintainer
#0 lore raw

PATCH 1/1 ipvs: fix matching of fwmark templates during scheduling

	Commit f11017ec2d1859c661f4e2b12c4a8d250e1f47cf (2.6.37)

moved the fwmark variable in subcontext that is invalidated before reaching the ip_vs_ct_in_get call. As vaddr is provided as pointer in the param structure make sure the fwmark variable is in same context. As the fwmark templates can not be matched, more and more template connections are created and the controlled connections can not go to single real server.

---
 net/netfilter/ipvs/ip_vs_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/netfilter/ipvs/ip_vs_core.c +1 -1
index 749aeae..b3686d8 100644
@@ -232,6 +232,7 @@ ip_vs_sched_persist(struct ip_vs_service *svc,
 	__be16 dport = 0;		/* destination port to forward */
 	unsigned int flags;
 	struct ip_vs_conn_param param;
+	const union nf_inet_addr fwmark = { .ip = htonl(svc->fwmark) };
 	union nf_inet_addr snet;	/* source network of the client,
 					   after masking */
 
@@ -267,7 +268,6 @@ ip_vs_sched_persist(struct ip_vs_service *svc,
 	{
 		int protocol = iph.protocol;
 		const union nf_inet_addr *vaddr = &iph.daddr;
-		const union nf_inet_addr fwmark = { .ip = htonl(svc->fwmark) };
 		__be16 vport = 0;
 
 		if (dst_port == svc->port) {
Signature · 1 line
1.7.3.4
maintainer
#1 lore raw
Quoted 7 lines · Julian Anastasov
	Commit f11017ec2d1859c661f4e2b12c4a8d250e1f47cf (2.6.37)

moved the fwmark variable in subcontext that is invalidated before reaching the ip_vs_ct_in_get call. As vaddr is provided as pointer in the param structure make sure the fwmark variable is in same context. As the fwmark templates can not be matched, more and more template connections are created and the controlled connections can not go to single real server.

Ouch, my bad.

I will forward on for inclusion in 3.3 and stable.