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: Todd Lyons <tlyons@xxxxxxxxxx>
Date: Tue, 18 Oct 2005 10:15:19 -0700
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.

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.


--- /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);
        };

-- 
Regards...              Todd
Well, it's Karch...   --frequently heard after every amazing move he does
Linux kernel 2.6.12-12mdksmp   3 users,  load average: 1.18, 1.18, 1.18

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