On Wed, Feb 16, 2011 at 01:04:12AM +0100, Ferenc Wagner wrote: > Simon Horman <ho...@verge.net.au> writes: > > > On Tue, Feb 15, 2011 at 05:44:32PM +0900, Sohgo Takeuchi wrote: > >> > >> From: Ferenc Wagner <wf...@niif.hu> > >> > >>> Sohgo Takeuchi <so...@sohgo.dyndns.org> writes: > >>> > >>>> From: Ferenc Wagner <wf...@niif.hu> > >>>> > >>>>> I'm running ldirectord with > >>>>> http://hg.linux-ha.org/agents/rev/6e8b562f5414 applied for better IPv6 > >>>>> support. Basically, it works fine, thanks for implementing this. But I > >>>>> wonder whether there's a fundamental reason for not allowing IPv4 and > >>>>> IPv6 virtual services with the same fwmark, like > >>>>> > >>>>> virtual=1 > >>>>> [...] > >>>>> virtual6=1 > >>>>> [...] > >>>>> > >>>>> which results in > >>>>> > >>>>> Error [21297] reading file /etc/ldirectord.cf at line 15: duplicate > >>>>> virtual server > >>>>> > >>>>> if tried. Is this only an overzealous sanity check in ldirectord, or > >>>>> are iptables and ip6tables fwmarks actually related somehow? > >>>> > >>>> Thanks for the report. > >>>> > >>>> When I enhanced the IPv6 support of ldirectord, I forgotten to > >>>> take care about this case. I also think that ldirectord should > >>>> support this case. > >>> > >>> Great, and thanks for taking care of IPv6 support in ldirectord! > >>> So what do you think about my patch? Not that I feel strongly about > >>> it, but I'd better stop using it if it's broken... > >> > >> I've used your patch. It works good in my environment too. > >> Thanks for the patch! > > > > Thanks guys, > > > > Ferenc are you happy to have this patch included in ldirectord > > which is GPLv2 licensed code? > > Yes, absolutely.
Thanks, I have queued up the following for inclusion in http://hg.linux-ha.org/agents. Please take a moment to double check that it is correct. # HG changeset patch # User Ferenc Wagner <wf...@niif.hu> # Date 1297835408 -32400 # Node ID 8427c046434779da1972463718443452f9fefdc1 # Parent fa9903f21432e2b450bbb6bb16b5f44121629792 ldirectord: remove duplicate assignment of virtual_id This allows IPv4 and IPv6 services to use the same fwmark. Signed-off-by: Simon Horman <ho...@verge.net.au> diff -r fa9903f21432 -r 8427c0464347 ldirectord/ldirectord.in --- a/ldirectord/ldirectord.in Sat Feb 12 19:32:35 2011 +0900 +++ b/ldirectord/ldirectord.in Wed Feb 16 14:50:08 2011 +0900 @@ -1301,13 +1301,13 @@ my $fallback_line; my @rsrv_todo; if ($vattr =~ /^(\d+\.\d+\.\d+\.\d+):([0-9A-Za-z-_]+)/ && $af == AF_INET) { - $virtual_id = $ip_port = "$1:$2"; + $ip_port = "$1:$2"; $virtual_port = $2; } elsif ($vattr =~ /^([0-9A-Za-z._+-]+):([0-9A-Za-z-_]+)/) { - $virtual_id = $ip_port = "$1:$2"; + $ip_port = "$1:$2"; $virtual_port = $2; } elsif ($vattr =~ /^(\d+)/){ - $virtual_id = $fwm = $1; + $fwm = $1; } elsif ($vattr =~ /^\[([0-9A-Fa-f:]+)\]:([0-9A-Za-z-_]+)/ && $af == AF_INET) { &config_error($line, "cannot specify an IPv6 address here. please use \"virtual6\" instead."); } elsif ($vattr =~ /^\[([0-9A-Fa-f:]+)\]:([0-9A-Za-z-_]+)/ && $af == AF_INET6) { @@ -1316,7 +1316,7 @@ if (!inet_pton(AF_INET6,$v6addr)) { &config_error($line,"invalid ipv6 address for virtual server"); } - $virtual_id = $ip_port = "[$v6addr]:$v6port"; + $ip_port = "[$v6addr]:$v6port"; $virtual_port = $v6port; } else { &config_error($line, @@ -4804,7 +4804,7 @@ { my ($v) = (@_); - return $v->{"protocol"} . ":" . &get_virtual($v); + return $v->{"protocol"} . ($v->{addressfamily} == AF_INET6?"6":"") . ":" . &get_virtual($v); } # get_forward_flag _______________________________________________ Please read the documentation before posting - it's available at: http://www.linuxvirtualserver.org/ LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org Send requests to lvs-users-requ...@linuxvirtualserver.org or go to http://lists.graemef.net/mailman/listinfo/lvs-users