SYSTEM WARNING: 'file_get_contents(https://www.clearos.com/?rendertype=json&get=header): failed to open stream: Connection refused' in '/var/www/virtual/newwrapper/cf_topmenu.inc' line 5

ClearOS Bug Tracker


View Revisions: Issue #7891 All Revisions ] Back to Issue ]
Summary 0007891: Wrong IP may update on MultiWAN
Revision 2016-03-30 06:57 by bchambers
Description If a multiWAN system with a preference selected for a particular interface is assigned private IP's, Dynamic DNS ip referrer may use any route to fetch the address, and not end up using the preferred interface.

A proposed fix would be to modify the following files:

/usr/clearos/apps/clearcenter/libraries/Web_Service.php

public function request($action, $postfields = "")

to

public function request($action, $postfields = "", $bind = NULL)

add to "Set main curl options" section:

if ($bind != NULL)
   curl_setopt($ch, CURLOPT_INTERFACE, $bind);

/usr/clearos/apps/dynamic_dns/libraries/DNS_Update.php

Line 229

$ip = $ip_referrer->get();

to

$ip = $ip_referrer->get($ip);

/usr/clearos/apps/dynamic_dns/libraries/IP_Referrer.php

public function get()
    {
        $payload = $this->request('getip', NULL);

        return $payload;
    }

to

public function get($bind_ip)
    {
        $payload = $this->request('getip', NULL, $bind_ip);

        return $payload;
    }
Revision 2016-03-30 06:52 by bchambers
Description If a multiWAN system with a preference selected for a particular interface is assigned private IP's, Dynamic DNS ip referrer may use any route to fetch the address, and not end up using the preferred interface.

A proposed fix would be to modify the following files:

/usr/clearos/apps/clearcenter/libraries/Web_Service.php

public function request($action, $postfields = "")

to

public function request($action, $postfields = "", $bind = NULL)

if ($bind != NULL)
   curl_setopt($ch, CURLOPT_INTERFACE, $bind);

/usr/clearos/apps/dynamic_dns/libraries/DNS_Update.php

Line 229

$ip = $ip_referrer->get();

to

$ip = $ip_referrer->get($ip);

/usr/clearos/apps/dynamic_dns/libraries/IP_Referrer.php

public function get()
    {
        $payload = $this->request('getip', NULL);

        return $payload;
    }

to

public function get($bind_ip)
    {
        $payload = $this->request('getip', NULL, $bind_ip);

        return $payload;
    }

SYSTEM WARNING: 'file_get_contents(https://www.clearos.com/?rendertype=json&get=footer): failed to open stream: Connection refused' in '/var/www/virtual/newwrapper/cf_footer.inc' line 7