From mquero@one-esecurity.com  Tue Dec 20 13:08:02 2016
Received: (at submit) by bugs.x2go.org; 20 Dec 2016 12:08:04 +0000
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,HTML_MESSAGE,
	URIBL_BLOCKED autolearn=ham version=3.3.2
Received: from localhost (localhost [127.0.0.1])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTP id 7D42B3CC60
	for <submit@bugs.x2go.org>; Tue, 20 Dec 2016 13:08:02 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at ymir.das-netzwerkteam.de
Received: from ymir.das-netzwerkteam.de ([127.0.0.1])
	by localhost (ymir.das-netzwerkteam.de [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id XAUy3DceTBoK for <submit@bugs.x2go.org>;
	Tue, 20 Dec 2016 13:07:55 +0100 (CET)
X-Greylist: delayed 724 seconds by postgrey-1.34 at ymir.das-netzwerkteam.de; Tue, 20 Dec 2016 13:07:55 CET
Received: from jessland.net (200.red-81-47-178.staticip.rima-tde.net [81.47.178.200])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id 408CA3CC5F
	for <submit@bugs.x2go.org>; Tue, 20 Dec 2016 13:07:55 +0100 (CET)
Received: from [127.0.0.1] (202.red-80-28-148.adsl.static.ccgg.telefonica.net [80.28.148.202])
	by jessland.net (8.12.11/8.12.11) with ESMTP id uBIE2L02006592
	for <submit@bugs.x2go.org>; Sun, 18 Dec 2016 15:02:42 +0100 (CET)
To: submit@bugs.x2go.org
From: Miguel Quero <mquero@one-esecurity.com>
Subject: x2gobroker-ssh big delay in session status recovery
Message-ID: <39e399fd-41ad-bb00-0abd-7b5401bbe82f@one-esecurity.com>
Date: Tue, 20 Dec 2016 12:55:21 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.5.1
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------DEE3B450ED3861DE2173B678"

This is a multi-part message in MIME format.
--------------DEE3B450ED3861DE2173B678
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Package: x2gobroker
Version: 0.0.3.1

When x2gobroker-ssh is used with system with not IPv6 configured, this generate very big delays in x2gobroker listsession task.

Before some research, the problem become from x2gobroker.utils portscan function.

This function propagates a delay in all agents call because it tests first the IPV6 connection:

/ip_proto = 0////try:////socket.getaddrinfo(addr, None, socket.AF_INET6)////ip_proto = 6////except socket.gaierror:////try:////socket.getaddrinfo(addr, None, socket.AF_INET)////ip_proto = 4////except socket.gaierror:////# we can't find a valid address for this host, so returning a failure...////return False /This will be fixed testing IPv4 first or more easily, setting a new option in config to select the ip protocol.

Best regards.
 


-- 
Miguel Quero | One eSecurity | www.one-esecurity.com
M: +34 608 36 17 05
Europe (Spain): +34 911 011 000
PGP: 0x34AA 050B D15C 7593 5671 3748 40C6 8E95 6C5A 40D3


--------------DEE3B450ED3861DE2173B678
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <pre>Package: x2gobroker
Version: 0.0.3.1

When x2gobroker-ssh is used with system with not IPv6 configured, this generate very big delays in x2gobroker listsession task.

Before some research, the problem become from x2gobroker.utils portscan function.

This function propagates a delay in all agents call because it tests first the IPV6 connection:

<i>    ip_proto = 0</i><i>
</i><i>    try:</i><i>
</i><i>        socket.getaddrinfo(addr, None, socket.AF_INET6)</i><i>
</i><i>        ip_proto = 6</i><i>
</i><i>    except socket.gaierror:</i><i>
</i><i>        try:</i><i>
</i><i>            socket.getaddrinfo(addr, None, socket.AF_INET)</i><i>
</i><i>            ip_proto = 4</i><i>
</i><i>        except socket.gaierror:</i><i>
</i><i>            # we can't find a valid address for this host, so returning a failure...</i><i>
</i><i>            return False

</i>This will be fixed testing IPv4 first or more easily, setting a new option in config to select the ip protocol.

Best regards.
 
</pre>
    <br>
    <pre class="moz-signature" cols="72">-- 
Miguel Quero | One eSecurity | <a class="moz-txt-link-abbreviated" href="http://www.one-esecurity.com">www.one-esecurity.com</a>
M: +34 608 36 17 05
Europe (Spain): +34 911 011 000
PGP: 0x34AA 050B D15C 7593 5671 3748 40C6 8E95 6C5A 40D3</pre>
  </body>
</html>

--------------DEE3B450ED3861DE2173B678--

