netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL net-next] IPVS
@ 2011-12-30  5:19 Simon Horman
  2011-12-30  5:19 ` [PATCH] ipvs: try also real server with port 0 in backup server Simon Horman
  2011-12-30 11:24 ` [GIT PULL net-next] IPVS Pablo Neira Ayuso
  0 siblings, 2 replies; 7+ messages in thread
From: Simon Horman @ 2011-12-30  5:19 UTC (permalink / raw)
  To: Patrick McHardy, Pablo Neira Ayuso
  Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
	Julian Anastasov

Hi Pablo,

please consider pulling
  git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-next master

To get the following fix from Julian

Julian Anastasov (1):
      ipvs: try also real server with port 0 in backup server

 include/net/ip_vs.h             |    2 +-
 net/netfilter/ipvs/ip_vs_conn.c |    2 +-
 net/netfilter/ipvs/ip_vs_ctl.c  |   10 ++++++++--
 net/netfilter/ipvs/ip_vs_sync.c |    2 +-
 4 files changed, 11 insertions(+), 5 deletions(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ipvs: try also real server with port 0 in backup server
  2011-12-30  5:19 [GIT PULL net-next] IPVS Simon Horman
@ 2011-12-30  5:19 ` Simon Horman
  2011-12-31 15:08   ` Pablo Neira Ayuso
  2011-12-30 11:24 ` [GIT PULL net-next] IPVS Pablo Neira Ayuso
  1 sibling, 1 reply; 7+ messages in thread
From: Simon Horman @ 2011-12-30  5:19 UTC (permalink / raw)
  To: Patrick McHardy, Pablo Neira Ayuso
  Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
	Julian Anastasov, Simon Horman

From: Julian Anastasov <ja@ssi.bg>

	We should not forget to try for real server with port 0
in the backup server when processing the sync message. We should
do it in all cases because the backup server can use different
forwarding method.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 include/net/ip_vs.h             |    2 +-
 net/netfilter/ipvs/ip_vs_conn.c |    2 +-
 net/netfilter/ipvs/ip_vs_ctl.c  |   10 ++++++++--
 net/netfilter/ipvs/ip_vs_sync.c |    2 +-
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 48fd12e..ebe517f 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -1207,7 +1207,7 @@ extern void ip_vs_control_cleanup(void);
 extern struct ip_vs_dest *
 ip_vs_find_dest(struct net *net, int af, const union nf_inet_addr *daddr,
 		__be16 dport, const union nf_inet_addr *vaddr, __be16 vport,
-		__u16 protocol, __u32 fwmark);
+		__u16 protocol, __u32 fwmark, __u32 flags);
 extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp);
 
 
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 12571fb..29fa5ba 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -616,7 +616,7 @@ struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp)
 	if ((cp) && (!cp->dest)) {
 		dest = ip_vs_find_dest(ip_vs_conn_net(cp), cp->af, &cp->daddr,
 				       cp->dport, &cp->vaddr, cp->vport,
-				       cp->protocol, cp->fwmark);
+				       cp->protocol, cp->fwmark, cp->flags);
 		ip_vs_bind_dest(cp, dest);
 		return dest;
 	} else
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 008bf97..e1a66cf 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -619,15 +619,21 @@ struct ip_vs_dest *ip_vs_find_dest(struct net  *net, int af,
 				   const union nf_inet_addr *daddr,
 				   __be16 dport,
 				   const union nf_inet_addr *vaddr,
-				   __be16 vport, __u16 protocol, __u32 fwmark)
+				   __be16 vport, __u16 protocol, __u32 fwmark,
+				   __u32 flags)
 {
 	struct ip_vs_dest *dest;
 	struct ip_vs_service *svc;
+	__be16 port = dport;
 
 	svc = ip_vs_service_get(net, af, fwmark, protocol, vaddr, vport);
 	if (!svc)
 		return NULL;
-	dest = ip_vs_lookup_dest(svc, daddr, dport);
+	if (fwmark && (flags & IP_VS_CONN_F_FWD_MASK) != IP_VS_CONN_F_MASQ)
+		port = 0;
+	dest = ip_vs_lookup_dest(svc, daddr, port);
+	if (!dest)
+		dest = ip_vs_lookup_dest(svc, daddr, port ^ dport);
 	if (dest)
 		atomic_inc(&dest->refcnt);
 	ip_vs_service_put(svc);
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index bcf5563..8a0d6d6 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -740,7 +740,7 @@ static void ip_vs_proc_conn(struct net *net, struct ip_vs_conn_param *param,
 		 * but still handled.
 		 */
 		dest = ip_vs_find_dest(net, type, daddr, dport, param->vaddr,
-				       param->vport, protocol, fwmark);
+				       param->vport, protocol, fwmark, flags);
 
 		/*  Set the approprite ativity flag */
 		if (protocol == IPPROTO_TCP) {
-- 
1.7.6.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [GIT PULL net-next] IPVS
  2011-12-30  5:19 [GIT PULL net-next] IPVS Simon Horman
  2011-12-30  5:19 ` [PATCH] ipvs: try also real server with port 0 in backup server Simon Horman
@ 2011-12-30 11:24 ` Pablo Neira Ayuso
  2011-12-31  0:09   ` Julian Anastasov
  2011-12-31  9:06   ` Simon Horman
  1 sibling, 2 replies; 7+ messages in thread
From: Pablo Neira Ayuso @ 2011-12-30 11:24 UTC (permalink / raw)
  To: Simon Horman
  Cc: Patrick McHardy, lvs-devel, netdev, netfilter-devel,
	Wensong Zhang, Julian Anastasov

Hi Simon,

On Fri, Dec 30, 2011 at 02:19:01PM +0900, Simon Horman wrote:
> Hi Pablo,
> 
> please consider pulling
>   git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-next
>   master

Since this is a fix, I can try to pass this for 3.2-rc7 to davem. I
read Linus will release 3.2 by new year, so we can still try to see if
we can get it in time.

Let me know what you prefer.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT PULL net-next] IPVS
  2011-12-30 11:24 ` [GIT PULL net-next] IPVS Pablo Neira Ayuso
@ 2011-12-31  0:09   ` Julian Anastasov
  2011-12-31  9:06   ` Simon Horman
  1 sibling, 0 replies; 7+ messages in thread
From: Julian Anastasov @ 2011-12-31  0:09 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: Simon Horman, Patrick McHardy, lvs-devel, netdev, netfilter-devel,
	Wensong Zhang


	Hello,

On Fri, 30 Dec 2011, Pablo Neira Ayuso wrote:

> Hi Simon,
> 
> On Fri, Dec 30, 2011 at 02:19:01PM +0900, Simon Horman wrote:
> > Hi Pablo,
> > 
> > please consider pulling
> >   git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-next
> >   master
> 
> Since this is a fix, I can try to pass this for 3.2-rc7 to davem. I
> read Linus will release 3.2 by new year, so we can still try to see if
> we can get it in time.
> 
> Let me know what you prefer.

	It is a good idea, if it is not too late.

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT PULL net-next] IPVS
  2011-12-30 11:24 ` [GIT PULL net-next] IPVS Pablo Neira Ayuso
  2011-12-31  0:09   ` Julian Anastasov
@ 2011-12-31  9:06   ` Simon Horman
  2011-12-31 15:08     ` Pablo Neira Ayuso
  1 sibling, 1 reply; 7+ messages in thread
From: Simon Horman @ 2011-12-31  9:06 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: Patrick McHardy, lvs-devel, netdev, netfilter-devel,
	Wensong Zhang, Julian Anastasov

On Fri, Dec 30, 2011 at 12:24:19PM +0100, Pablo Neira Ayuso wrote:
> Hi Simon,
> 
> On Fri, Dec 30, 2011 at 02:19:01PM +0900, Simon Horman wrote:
> > Hi Pablo,
> > 
> > please consider pulling
> >   git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-next
> >   master
> 
> Since this is a fix, I can try to pass this for 3.2-rc7 to davem. I
> read Linus will release 3.2 by new year, so we can still try to see if
> we can get it in time.
> 
> Let me know what you prefer.

Hi Pablo,

please try for 3.2-rc7 if possible.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT PULL net-next] IPVS
  2011-12-31  9:06   ` Simon Horman
@ 2011-12-31 15:08     ` Pablo Neira Ayuso
  0 siblings, 0 replies; 7+ messages in thread
From: Pablo Neira Ayuso @ 2011-12-31 15:08 UTC (permalink / raw)
  To: Simon Horman
  Cc: Patrick McHardy, lvs-devel, netdev, netfilter-devel,
	Wensong Zhang, Julian Anastasov

On Sat, Dec 31, 2011 at 06:06:25PM +0900, Simon Horman wrote:
> On Fri, Dec 30, 2011 at 12:24:19PM +0100, Pablo Neira Ayuso wrote:
> > Hi Simon,
> > 
> > On Fri, Dec 30, 2011 at 02:19:01PM +0900, Simon Horman wrote:
> > > Hi Pablo,
> > > 
> > > please consider pulling
> > >   git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-next
> > >   master
> > 
> > Since this is a fix, I can try to pass this for 3.2-rc7 to davem. I
> > read Linus will release 3.2 by new year, so we can still try to see if
> > we can get it in time.
> > 
> > Let me know what you prefer.
> 
> Hi Pablo,
> 
> please try for 3.2-rc7 if possible.

OK, let's try!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ipvs: try also real server with port 0 in backup server
  2011-12-30  5:19 ` [PATCH] ipvs: try also real server with port 0 in backup server Simon Horman
@ 2011-12-31 15:08   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 7+ messages in thread
From: Pablo Neira Ayuso @ 2011-12-31 15:08 UTC (permalink / raw)
  To: Simon Horman
  Cc: Patrick McHardy, lvs-devel, netdev, netfilter-devel,
	Wensong Zhang, Julian Anastasov

On Fri, Dec 30, 2011 at 02:19:02PM +0900, Simon Horman wrote:
> From: Julian Anastasov <ja@ssi.bg>
> 
> 	We should not forget to try for real server with port 0
> in the backup server when processing the sync message. We should
> do it in all cases because the backup server can use different
> forwarding method.
> 
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
> Signed-off-by: Simon Horman <horms@verge.net.au>

Applied, thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-12-31 15:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-30  5:19 [GIT PULL net-next] IPVS Simon Horman
2011-12-30  5:19 ` [PATCH] ipvs: try also real server with port 0 in backup server Simon Horman
2011-12-31 15:08   ` Pablo Neira Ayuso
2011-12-30 11:24 ` [GIT PULL net-next] IPVS Pablo Neira Ayuso
2011-12-31  0:09   ` Julian Anastasov
2011-12-31  9:06   ` Simon Horman
2011-12-31 15:08     ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).