http://qa.mandrakesoft.com/show_bug.cgi?id=6159

           Product: drakxtools
         Component: DrakConnect
           Summary: When named is installed, drakconnect always believes
                    connection is active
           Product: drakxtools
           Version: 9.2-17mdk
          Platform: PC
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: DrakConnect
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Drakconnect uses a script tools.pm in /usr/lib/libDrakX/network
The function connect2 is used to determine whether the connection is active or
not, unfortunately it's based on gethostbyname().

When named is installed (for example because the DNS of our ISP are too
unreliable...) the result is always true... so connection cannot be initiated
(the button Connect is greyed).

Here is a proposal of modification to add a ping that will really tell that the
connection is active :
==== /usr/lib/libDrakX/network/tools.pm ====
sub connected2 {
    if ($kid_pid = open(my $kid_to_read, "-|")) {
        #- parent
        $kid_to_read;
    } else {
        #- child
        #my $a = gethostbyname("mandrakesoft.com") ? 1 : 0;
        # === nouveau test ===
        use Net::Ping;
        use Socket;
        my $addr = gethostbyname("www.free.fr");
        my $ip = inet_ntoa($addr);
        $p = Net::Ping->new();
        my $a = ($p->ping($ip)) ? 1 : 0;
        $p->close();
        # --------------------
        print $a;
        c::_exit(0);
    }
}

Sorry, we've put free.fr instead of mandrakesoft.com, maybe there should be
w3.org to please anybody ?

-- 
Configure bugmail: http://qa.mandrakesoft.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

Reply via email to