From 7c5bebc943557d771d0310bb7d82fbfbcc51b62b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 11 Dec 2017 16:10:38 +0100 Subject: [dnbd3] Allow configuring alternative IP address for managed proxy --- modules-available/dnbd3/inc/dnbd3util.inc.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'modules-available/dnbd3/inc/dnbd3util.inc.php') diff --git a/modules-available/dnbd3/inc/dnbd3util.inc.php b/modules-available/dnbd3/inc/dnbd3util.inc.php index 02ca89c2..95b6ffe2 100644 --- a/modules-available/dnbd3/inc/dnbd3util.inc.php +++ b/modules-available/dnbd3/inc/dnbd3util.inc.php @@ -11,10 +11,10 @@ class Dnbd3Util { FROM dnbd3_server s LEFT JOIN machine m USING (machineuuid)'); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - if (!is_null($row['clientip'])) { - $ip = $row['clientip']; - } elseif (!is_null($row['fixedip'])) { + if (!is_null($row['fixedip'])) { $ip = $row['fixedip']; + } elseif (!is_null($row['clientip'])) { + $ip = $row['clientip']; } else { continue; // Huh? } @@ -25,6 +25,9 @@ class Dnbd3Util { RunMode::setRunMode($row['machineuuid'], 'dnbd3', null, null, null); continue; } + } elseif ($ip === $satServerIp) { + // Manually configured sat server as dnbd3 server - makes no sense + continue; } $server = array( 'serverid' => $row['serverid'], @@ -141,7 +144,7 @@ class Dnbd3Util { $self = Property::getServerIp(); $public[$self] = $self; while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - $ip = $row['clientip'] ? $row['clientip'] : $row['fixedip']; + $ip = $row['fixedip'] ? $row['fixedip'] : $row['clientip']; if ($ip === '') { continue; } -- cgit v1.2.3-55-g7522