summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/filter.inc19
1 files changed, 17 insertions, 2 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index f22c1a9..a7693b1 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1342,8 +1342,23 @@ function generate_user_filter_rule($rule, $ngcounter) {
/* if user has selected a custom gateway, lets work with it */
if($rule['gateway'] <> "") {
- $int = guess_interface_from_ip($rule['gateway']);
- $line .= " route-to (" . $int . " " . $rule['gateway'] . ") ";
+ $foundlb = 0;
+ foreach($config['load_balancer']['lbpool'] as $lb) {
+ if($lb['name'] == $rule['gateway']) {
+ $servers = "";
+ /* XXX: when slbd writes out helper file,
+ * simply read in and feed to route-to
+ */
+ foreach($lb['servers'] as $server) {
+ $servers .= $server . " ";
+ }
+ $line .= " route-to (" . $int . " " . $servers . ") ";
+ }
+ }
+ if($foundlb == 0) {
+ $int = guess_interface_from_ip($rule['gateway']);
+ $line .= " route-to (" . $int . " " . $rule['gateway'] . ") ";
+ }
}
/* Setup outgoing load balancing */
OpenPOWER on IntegriCloud