netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/10] ipvs: Use IP_VS_RT_MODE_* instead of magic constants.
@ 2011-05-10  5:31 David Miller
  2011-05-10 22:26 ` Julian Anastasov
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2011-05-10  5:31 UTC (permalink / raw)
  To: netdev


Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/netfilter/ipvs/ip_vs_xmit.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 6132b21..c4a19f9 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -440,7 +440,8 @@ ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
 
 	EnterFunction(10);
 
-	if (!(rt = __ip_vs_get_out_rt_v6(skb, NULL, &iph->daddr, NULL, 0, 2)))
+	if (!(rt = __ip_vs_get_out_rt_v6(skb, NULL, &iph->daddr, NULL, 0,
+					 IP_VS_RT_MODE_NON_LOCAL)))
 		goto tx_error_icmp;
 
 	/* MTU checking */
@@ -632,7 +633,9 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
 	}
 
 	if (!(rt = __ip_vs_get_out_rt_v6(skb, cp->dest, &cp->daddr.in6, NULL,
-					 0, 1|2|4)))
+					 0, (IP_VS_RT_MODE_LOCAL |
+					     IP_VS_RT_MODE_NON_LOCAL |
+					     IP_VS_RT_MODE_RDR))))
 		goto tx_error_icmp;
 	local = __ip_vs_is_local_route6(rt);
 	/*
@@ -875,7 +878,8 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
 	EnterFunction(10);
 
 	if (!(rt = __ip_vs_get_out_rt_v6(skb, cp->dest, &cp->daddr.in6,
-					 &saddr, 1, 1|2)))
+					 &saddr, 1, (IP_VS_RT_MODE_LOCAL |
+						     IP_VS_RT_MODE_NON_LOCAL))))
 		goto tx_error_icmp;
 	if (__ip_vs_is_local_route6(rt)) {
 		dst_release(&rt->dst);
@@ -1050,7 +1054,8 @@ ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
 	EnterFunction(10);
 
 	if (!(rt = __ip_vs_get_out_rt_v6(skb, cp->dest, &cp->daddr.in6, NULL,
-					 0, 1|2)))
+					 0, (IP_VS_RT_MODE_LOCAL |
+					     IP_VS_RT_MODE_NON_LOCAL))))
 		goto tx_error_icmp;
 	if (__ip_vs_is_local_route6(rt)) {
 		dst_release(&rt->dst);
@@ -1254,7 +1259,9 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
 	 */
 
 	if (!(rt = __ip_vs_get_out_rt_v6(skb, cp->dest, &cp->daddr.in6, NULL,
-					 0, 1|2|4)))
+					 0, (IP_VS_RT_MODE_LOCAL |
+					     IP_VS_RT_MODE_NON_LOCAL |
+					     IP_VS_RT_MODE_RDR))))
 		goto tx_error_icmp;
 
 	local = __ip_vs_is_local_route6(rt);
-- 
1.7.5.1


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

* Re: [PATCH 4/10] ipvs: Use IP_VS_RT_MODE_* instead of magic constants.
  2011-05-10  5:31 [PATCH 4/10] ipvs: Use IP_VS_RT_MODE_* instead of magic constants David Miller
@ 2011-05-10 22:26 ` Julian Anastasov
  2011-05-10 22:30   ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Julian Anastasov @ 2011-05-10 22:26 UTC (permalink / raw)
  To: David Miller; +Cc: netdev


	Fix more IP_VS_RT_MODE_* constants

Signed-off-by: Julian Anastasov <ja@ssi.bg>
---

	Following patch can be used after patch 4, eg. as
number 6 because patches 4 and 5 are ok and we are going to replace
patches 6 and 7.

diff -urp net-next-2.6-7ef73bc/linux/net/netfilter/ipvs/ip_vs_xmit.c linux/net/netfilter/ipvs/ip_vs_xmit.c
--- net-next-2.6-7ef73bc/linux/net/netfilter/ipvs/ip_vs_xmit.c	2011-05-10 23:51:34.831272176 +0300
+++ linux/net/netfilter/ipvs/ip_vs_xmit.c	2011-05-10 23:51:28.900271527 +0300
@@ -230,8 +230,6 @@ out_err:
 
 /*
  * Get route to destination or remote server
- * rt_mode: flags, &1=Allow local dest, &2=Allow non-local dest,
- *	    &4=Allow redirect from remote daddr to local
  */
 static struct rt6_info *
 __ip_vs_get_out_rt_v6(struct sk_buff *skb, struct ip_vs_dest *dest,
@@ -275,13 +273,14 @@ __ip_vs_get_out_rt_v6(struct sk_buff *sk
 	}
 
 	local = __ip_vs_is_local_route6(rt);
-	if (!((local ? 1 : 2) & rt_mode)) {
+	if (!((local ? IP_VS_RT_MODE_LOCAL : IP_VS_RT_MODE_NON_LOCAL) &
+	      rt_mode)) {
 		IP_VS_DBG_RL("Stopping traffic to %s address, dest: %pI6\n",
 			     local ? "local":"non-local", daddr);
 		dst_release(&rt->dst);
 		return NULL;
 	}
-	if (local && !(rt_mode & 4) &&
+	if (local && !(rt_mode & IP_VS_RT_MODE_RDR) &&
 	    !((ort = (struct rt6_info *) skb_dst(skb)) &&
 	      __ip_vs_is_local_route6(ort))) {
 		IP_VS_DBG_RL("Redirect from non-local address %pI6 to local "

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

* Re: [PATCH 4/10] ipvs: Use IP_VS_RT_MODE_* instead of magic constants.
  2011-05-10 22:26 ` Julian Anastasov
@ 2011-05-10 22:30   ` David Miller
  2011-05-10 23:24     ` Julian Anastasov
  2011-05-11 23:32     ` Julian Anastasov
  0 siblings, 2 replies; 8+ messages in thread
From: David Miller @ 2011-05-10 22:30 UTC (permalink / raw)
  To: ja; +Cc: netdev

From: Julian Anastasov <ja@ssi.bg>
Date: Wed, 11 May 2011 01:26:09 +0300 (EEST)

> 
> 	Fix more IP_VS_RT_MODE_* constants
> 
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
> ---
> 
> 	Following patch can be used after patch 4, eg. as
> number 6 because patches 4 and 5 are ok and we are going to replace
> patches 6 and 7.

Thanks Julian.

What I'm going to do is hold back the IPVS parts of the patches I
posted last night.  In particular, I'll integrate this into the
original patch #4.

And then we can work through the reimplementation ideas you posted to
me in private email.

If you could post those ideas here on the list I'd appreciate it,
so others can follow along and provide feedback.

Thanks!

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

* Re: [PATCH 4/10] ipvs: Use IP_VS_RT_MODE_* instead of magic constants.
  2011-05-10 22:30   ` David Miller
@ 2011-05-10 23:24     ` Julian Anastasov
  2011-05-11  6:02       ` Hans Schillstrom
  2011-05-11 23:32     ` Julian Anastasov
  1 sibling, 1 reply; 8+ messages in thread
From: Julian Anastasov @ 2011-05-10 23:24 UTC (permalink / raw)
  To: David Miller; +Cc: netdev


	Hello,

On Tue, 10 May 2011, David Miller wrote:

> > 	Fix more IP_VS_RT_MODE_* constants
> > 
> > Signed-off-by: Julian Anastasov <ja@ssi.bg>
> > ---
> > 
> > 	Following patch can be used after patch 4, eg. as
> > number 6 because patches 4 and 5 are ok and we are going to replace
> > patches 6 and 7.
> 
> Thanks Julian.
> 
> What I'm going to do is hold back the IPVS parts of the patches I
> posted last night.  In particular, I'll integrate this into the
> original patch #4.
> 
> And then we can work through the reimplementation ideas you posted to
> me in private email.
> 
> If you could post those ideas here on the list I'd appreciate it,
> so others can follow along and provide feedback.

	I think, I included the main things in the comments
with patch 7. I forgot to tell that I'll do some IPVS-IPv4 tests
tomorrow. May be Hans will test the patches too.

Regards

--
Julian Anastasov <ja@ssi.bg>

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

* Re: [PATCH 4/10] ipvs: Use IP_VS_RT_MODE_* instead of magic constants.
  2011-05-10 23:24     ` Julian Anastasov
@ 2011-05-11  6:02       ` Hans Schillstrom
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Schillstrom @ 2011-05-11  6:02 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: David Miller, netdev@vger.kernel.org

Hi
On Wednesday 11 May 2011 01:24:42 Julian Anastasov wrote:
> 
> 	Hello,
> 
> On Tue, 10 May 2011, David Miller wrote:
> 
> > > 	Fix more IP_VS_RT_MODE_* constants
> > > 
> > > Signed-off-by: Julian Anastasov <ja@ssi.bg>
> > > ---
> > > 
> > > 	Following patch can be used after patch 4, eg. as
> > > number 6 because patches 4 and 5 are ok and we are going to replace
> > > patches 6 and 7.
> > 
> > Thanks Julian.
> > 
> > What I'm going to do is hold back the IPVS parts of the patches I
> > posted last night.  In particular, I'll integrate this into the
> > original patch #4.
> > 
> > And then we can work through the reimplementation ideas you posted to
> > me in private email.
> > 
> > If you could post those ideas here on the list I'd appreciate it,
> > so others can follow along and provide feedback.
> 
> 	I think, I included the main things in the comments
> with patch 7. I forgot to tell that I'll do some IPVS-IPv4 tests
> tomorrow. May be Hans will test the patches too.

It all looks good to me, I'll do some tests today.

> 
> Regards
> 
> --
> Julian Anastasov <ja@ssi.bg>

-- 
Regards
Hans Schillstrom <hans.schillstrom@ericsson.com>

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

* Re: [PATCH 4/10] ipvs: Use IP_VS_RT_MODE_* instead of magic constants.
  2011-05-10 22:30   ` David Miller
  2011-05-10 23:24     ` Julian Anastasov
@ 2011-05-11 23:32     ` Julian Anastasov
  2011-05-12  5:28       ` Hans Schillstrom
  2011-05-12 22:28       ` David Miller
  1 sibling, 2 replies; 8+ messages in thread
From: Julian Anastasov @ 2011-05-11 23:32 UTC (permalink / raw)
  To: David Miller; +Cc: netdev


	Hello,

On Tue, 10 May 2011, David Miller wrote:

> > 	Following patch can be used after patch 4, eg. as
> > number 6 because patches 4 and 5 are ok and we are going to replace
> > patches 6 and 7.
> 
> Thanks Julian.
> 
> What I'm going to do is hold back the IPVS parts of the patches I
> posted last night.  In particular, I'll integrate this into the
> original patch #4.
> 
> And then we can work through the reimplementation ideas you posted to
> me in private email.

	My simple tests do not show any problems with patches
4, 5 and the new 6 and 7. I tested TUN mode for rt_src/rt_dst
and DR/NAT for rt_dst replacement, related ICMP is relayed properly.
So, we should be ok but I'll do more tests in the following
days because the list with possible combinations for testing
is too long: different forwarding mode (DR/TUN/NAT),
local or remote real server, local or remote client,
In or Out related ICMP, Passive or Active FTP...

Regards

--
Julian Anastasov <ja@ssi.bg>

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

* Re: [PATCH 4/10] ipvs: Use IP_VS_RT_MODE_* instead of magic constants.
  2011-05-11 23:32     ` Julian Anastasov
@ 2011-05-12  5:28       ` Hans Schillstrom
  2011-05-12 22:28       ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: Hans Schillstrom @ 2011-05-12  5:28 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: David Miller, netdev@vger.kernel.org

On Thursday 12 May 2011 01:32:09 Julian Anastasov wrote:
> 
> 	Hello,
> 
> On Tue, 10 May 2011, David Miller wrote:
> 
> > > 	Following patch can be used after patch 4, eg. as
> > > number 6 because patches 4 and 5 are ok and we are going to replace
> > > patches 6 and 7.
> > 
> > Thanks Julian.
> > 
> > What I'm going to do is hold back the IPVS parts of the patches I
> > posted last night.  In particular, I'll integrate this into the
> > original patch #4.
> > 
> > And then we can work through the reimplementation ideas you posted to
> > me in private email.
> 
> 	My simple tests do not show any problems with patches
> 4, 5 and the new 6 and 7. I tested TUN mode for rt_src/rt_dst
> and DR/NAT for rt_dst replacement, related ICMP is relayed properly.
> So, we should be ok but I'll do more tests in the following
> days because the list with possible combinations for testing
> is too long: different forwarding mode (DR/TUN/NAT),
> local or remote real server, local or remote client,
> In or Out related ICMP, Passive or Active FTP...
> 
I will try to test the Backup/Failover aspects of above

-- 
Regards
Hans Schillstrom <hans.schillstrom@ericsson.com>

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

* Re: [PATCH 4/10] ipvs: Use IP_VS_RT_MODE_* instead of magic constants.
  2011-05-11 23:32     ` Julian Anastasov
  2011-05-12  5:28       ` Hans Schillstrom
@ 2011-05-12 22:28       ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2011-05-12 22:28 UTC (permalink / raw)
  To: ja; +Cc: netdev

From: Julian Anastasov <ja@ssi.bg>
Date: Thu, 12 May 2011 02:32:09 +0300 (EEST)

> 	My simple tests do not show any problems with patches
> 4, 5 and the new 6 and 7. I tested TUN mode for rt_src/rt_dst
> and DR/NAT for rt_dst replacement, related ICMP is relayed properly.
> So, we should be ok but I'll do more tests in the following
> days because the list with possible combinations for testing
> is too long: different forwarding mode (DR/TUN/NAT),
> local or remote real server, local or remote client,
> In or Out related ICMP, Passive or Active FTP...

Julian, I integrated your work and pushed 3 patches to net-next-2.6

1) Original patch #4 with your followup integrated
2) Original patch #5
3) You're replacement for original patch #6 and #7

Let me know if there are any followup fixes that we need to work
on.

Thanks!

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

end of thread, other threads:[~2011-05-12 22:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-10  5:31 [PATCH 4/10] ipvs: Use IP_VS_RT_MODE_* instead of magic constants David Miller
2011-05-10 22:26 ` Julian Anastasov
2011-05-10 22:30   ` David Miller
2011-05-10 23:24     ` Julian Anastasov
2011-05-11  6:02       ` Hans Schillstrom
2011-05-11 23:32     ` Julian Anastasov
2011-05-12  5:28       ` Hans Schillstrom
2011-05-12 22:28       ` David Miller

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).