LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Ldirectord and DNS problem using TCP and UDP

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Ldirectord and DNS problem using TCP and UDP
From: Horms <horms@xxxxxxxxxxxx>
Date: Wed, 19 Oct 2005 18:04:42 +0900
On Tue, Oct 18, 2005 at 10:15:19AM -0700, Todd Lyons wrote:
> Horms wanted us to know:
> 
> >> Yes.  ldirectord needs to be adjusted to check for tcp/udp specification
> >> and set it.  The Net::DNS::Resolver has an function usevc(int) that
> >> tells it to use TCP instead of UDP.  You could probably add the code if
> >Here is a patch that should resolve that problem. I have
> >committed to CVS as 1.122 / 1.77.2.34
> 
> I've been staring at this code for a bit now.  I can see that ldirectord
> won't choke on a config that's duplicated except for the protocol.
> But my current version of ldirectord is 
>   $Id: ldirectord,v 1.99 2005/02/24 09:07:00 horms Exp $
> and it doesn't choke on that duplicate config.  Looking at the diff to
> HEAD, it seems that quite a bit of code has changed, so that's probably
> why.

Yes, it does change quite a lot, I wish it would stop.

I seem to recall that the duplicate config check was added recently,
in response to another bug, versions prior to this shouldn't see the
originally reported problem.

> But it still only does a udp dns check, confirmed by a tcpdump.
> 
> The following allows it to do a udp check for the udp protocol and a tcp
> check for the tcp protocol (for the check dns sub only).  I'm not sure
> if you need to modify the regex to be more specific.

Can I clarify that if its a tcp check $res->usevc(1) shuold
be called, and other wise it wouldn't. If so I'd propose something like.

                if ($$v{"protocol"} eq "tcp") {
                        $res->usevc(1);
                }

Can you let me know if that works, it would be good to get this fixed,
sounds like its been there forever.

> --- /usr/sbin/ldirectord.orig   2005-10-18 10:00:03.000000000 -0700
> +++ /usr/sbin/ldirectord        2005-10-18 10:14:52.000000000 -0700
> @@ -2121,6 +2121,8 @@
>                  local $SIG{'ALRM'} = sub { die "timeout\n"; };
>                  alarm($$v{checktimeout});
>                  $res->nameservers($$r{server});
> +                # Configuration requested a TCP dns check
> +                $$v{"protocol"} =~ m/tcp/ and $res->usevc(1);
>                  $query = $res->search($request);
>                  alarm(0);
>         };

-- 
Horms

<Prev in Thread] Current Thread [Next in Thread>