Revision 39367ad7
Added by Scott Ullrich about 19 years ago
etc/inc/filter.inc | ||
---|---|---|
1212 | 1212 |
} else { |
1213 | 1213 |
$lbs = $lb['servers']; |
1214 | 1214 |
} |
1215 |
/* iterate through $lbs and setup items accordingly */ |
|
1216 |
foreach($lbs as $server) { |
|
1217 |
if($foundlb == 1) |
|
1218 |
$line .= ", "; |
|
1219 |
/* we are seperating the monitor address from the gateway |
|
1220 |
* using the | character |
|
1221 |
*/ |
|
1222 |
if(stristr($server, "|") == true) { |
|
1223 |
$split_ip = split("\|", $server); |
|
1224 |
$rule['gateway'] = $split_ip[0]; |
|
1225 |
$gateway = $split_ip[0]; |
|
1226 |
} |
|
1227 |
/* determine interface from gateway address */ |
|
1228 |
$int = guess_interface_from_ip($gateway); |
|
1229 |
$line .= "( {$int} {$gateway} ) "; |
|
1230 |
if($int == "") { |
|
1231 |
$line = "# error resolving load balancing {$gateway}"; |
|
1215 |
|
|
1216 |
/* iterate through $lbs and setup items accordingly */ |
|
1217 |
foreach($lbs as $server) { |
|
1218 |
for ($i = 0; isset($config['load_balancer']['lbpool'][$i]); $i++) { |
|
1219 |
foreach ($config['load_balancer']['lbpool'][$i]['servers'] as $lbsvr) { |
|
1220 |
$lbsvr_split=split("\|", $lbsvr); |
|
1221 |
if ($lbsvr_split[1] == $server) |
|
1222 |
$gateway = $lbsvr_split[1]; |
|
1223 |
} |
|
1232 | 1224 |
} |
1233 |
$foundlb = 1; |
|
1234 |
} |
|
1235 |
$line .= "} round-robin "; |
|
1225 |
if($foundlb == 1) |
|
1226 |
$line .= ", "; |
|
1227 |
/* determine interface from gateway address */ |
|
1228 |
$int = guess_interface_from_ip($gateway); |
|
1229 |
$line .= "( {$int} {$gateway} ) "; |
|
1230 |
if($int == "") { |
|
1231 |
$line = "# error resolving load balancing {$gateway}"; |
|
1232 |
} |
|
1233 |
$foundlb = 1; |
|
1234 |
} |
|
1235 |
$line .= "} round-robin "; |
|
1236 | 1236 |
} |
1237 | 1237 |
} |
1238 | 1238 |
} |
Also available in: Unified diff
MFC 11418
This should allow the gateway pools to be updated when the monitor ip is unavailable
Tickets: