All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][ldirectord] fix a bug that IPv6 does not work fine.
@ 2011-04-18 10:30 Sohgo Takeuchi
  2011-04-19  0:11 ` Simon Horman
  0 siblings, 1 reply; 3+ messages in thread
From: Sohgo Takeuchi @ 2011-04-18 10:30 UTC (permalink / raw)
  To: lvs-devel



Hi,

I found that the latest ldirectord did not work fine when using IPv6.
This issue was enbuged in following commits,
	commit f9c76a0f1d6e7c86ac741ed534c6661e22556fc2
	commit f85bdc302541aab3e32994b0d672e60a338a17c8
i.e. when added fixes to allow IPv4 and IPv6 services with same fwmark.
The fixes made same fwmark work good, but broke a behavior of IPv6
services. When I made the fix, my testing was not enough.

Attached patch fixes this problem.
This patch can also be found at https://github.com/sohgo/resource-agents/tree/bugfix-fwmk1

Thank you.

-- sohgo

---
 ldirectord/ldirectord.in |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/ldirectord/ldirectord.in b/ldirectord/ldirectord.in
index af55fda..646d687 100644
--- a/ldirectord/ldirectord.in
+++ b/ldirectord/ldirectord.in
@@ -2457,7 +2457,12 @@ sub get_real_service_str
 {
 	my ($v) = (@_);
 
-	return &get_virtual($v) . " "  . $v->{protocol} . ($v->{addressfamily} == AF_INET6 ? "6" : "");
+	if ($v->{"protocol"} eq "fwm") {
+		return &get_virtual($v) . " "  . $v->{protocol} . ($v->{addressfamily} == AF_INET6 ? "6" : "");
+	}
+	else {
+		return &get_virtual($v) . " "  . $v->{protocol};
+	}
 }
 
 sub ld_start
@@ -4119,7 +4124,7 @@ sub fallback_find
 	my ($virtual) = (@_);
 
 	my($global_fallback_ptr);	# fallback pointer
-	my $ipv6p = $virtual->{server} =~ /[\[\]]/ ? 1 : 0;
+	my $ipv6p = ($virtual->{addressfamily} == AF_INET6) ? 1 : 0;
 
 	if( defined $virtual->{"fallback"} ) {
 		return($virtual->{"fallback"});
@@ -4819,7 +4824,12 @@ sub get_virtual_id_str {
 	my ($v) = (@_);
 
-	return $v->{"protocol"} . ($v->{addressfamily} == AF_INET6?"6":"") . ":" .  &get_virtual($v);
+	if ($v->{"protocol"} eq "fwm") {
+		return $v->{"protocol"} . ($v->{addressfamily} == AF_INET6?"6":"") . ":" .  &get_virtual($v);
+	}
+	else {
+		return $v->{"protocol"} . ":" .  &get_virtual($v);
+	}
 }
 
 # get_forward_flag


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

* Re: [PATCH][ldirectord] fix a bug that IPv6 does not work fine.
  2011-04-18 10:30 [PATCH][ldirectord] fix a bug that IPv6 does not work fine Sohgo Takeuchi
@ 2011-04-19  0:11 ` Simon Horman
  2011-04-19  3:29   ` Sohgo Takeuchi
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2011-04-19  0:11 UTC (permalink / raw)
  To: Sohgo Takeuchi; +Cc: lvs-devel

On Mon, Apr 18, 2011 at 07:30:14PM +0900, Sohgo Takeuchi wrote:
> 
> 
> Hi,
> 
> I found that the latest ldirectord did not work fine when using IPv6.
> This issue was enbuged in following commits,
> 	commit f9c76a0f1d6e7c86ac741ed534c6661e22556fc2
> 	commit f85bdc302541aab3e32994b0d672e60a338a17c8
> i.e. when added fixes to allow IPv4 and IPv6 services with same fwmark.
> The fixes made same fwmark work good, but broke a behavior of IPv6
> services. When I made the fix, my testing was not enough.
> 
> Attached patch fixes this problem.
> This patch can also be found at https://github.com/sohgo/resource-agents/tree/bugfix-fwmk1

Thanks, applied to
git://github.com/horms/resource-agents.git
and pull request sent.

BTW, I pulled
https://github.com/sohgo/resource-agents.git heads/bugfix-fwmk1
in order to get the change.

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

* Re: [PATCH][ldirectord] fix a bug that IPv6 does not work fine.
  2011-04-19  0:11 ` Simon Horman
@ 2011-04-19  3:29   ` Sohgo Takeuchi
  0 siblings, 0 replies; 3+ messages in thread
From: Sohgo Takeuchi @ 2011-04-19  3:29 UTC (permalink / raw)
  To: horms; +Cc: lvs-devel


From: Simon Horman <horms@verge.net.au>
|
> On Mon, Apr 18, 2011 at 07:30:14PM +0900, Sohgo Takeuchi wrote:
>
>> I found that the latest ldirectord did not work fine when using IPv6.
>> This issue was enbuged in following commits,
>> 	commit f9c76a0f1d6e7c86ac741ed534c6661e22556fc2
>> 	commit f85bdc302541aab3e32994b0d672e60a338a17c8
>> i.e. when added fixes to allow IPv4 and IPv6 services with same fwmark.
>> The fixes made same fwmark work good, but broke a behavior of IPv6
>> services. When I made the fix, my testing was not enough.
>> 
>> Attached patch fixes this problem.
>> This patch can also be found at https://github.com/sohgo/resource-agents/tree/bugfix-fwmk1
> 
> Thanks, applied to
> git://github.com/horms/resource-agents.git
> and pull request sent.
> 
> BTW, I pulled
> https://github.com/sohgo/resource-agents.git heads/bugfix-fwmk1
> in order to get the change.

Hi, Simon

Thanks for accepting my patch and sending a pull request.

-- sohgo

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

end of thread, other threads:[~2011-04-19  3:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-18 10:30 [PATCH][ldirectord] fix a bug that IPv6 does not work fine Sohgo Takeuchi
2011-04-19  0:11 ` Simon Horman
2011-04-19  3:29   ` Sohgo Takeuchi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.