Skip to content

Commit

Permalink
gateways: may need this as well
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Sep 24, 2017
1 parent 678a209 commit a31a0a4
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/etc/inc/gwlb.inc
Expand Up @@ -209,6 +209,19 @@ EOD;
continue;
}

/*
* 'monitor' has been set, so makes sure it has precedence over
* 'gateway' in defining the source IP. Otherwise if 'gateway'
* is a local link and 'monitor' is global routable then the
* ICMP6 response would not find its way back home...
*/
if (is_linklocal($gateway['monitor']) && !strstr($gateway['monitor'], '%')) {
$gateway['monitor'] .= "%{$gateway['interface']}";
}
if (is_linklocal($gwifip) && !strstr($gwifip, '%')) {
$gwifip .= "%{$gateway['interface']}";
}

/* flush the monitor unconditionally */
if (is_ipaddrv6($gateway['gateway']) && $gateway['monitor'] != $gateway['gateway']) {
log_error("Removing static route for monitor {$gateway['monitor']} via {$gateway['gateway']}");
Expand All @@ -231,15 +244,6 @@ EOD;
system_host_route($gateway['monitor'], $gateway['gateway'], false, true);
}

/*
* 'monitor' has been set, so makes sure it has precedence over
* 'gateway' in defining the source IP. Otherwise if 'gateway'
* is a local link and 'monitor' is global routable then the
* ICMP6 response would not find its way back home...
*/
if (is_linklocal($gateway['monitor']) && !strstr($gateway['monitor'], '%')) {
$gateway['monitor'] .= "%{$gateway['interface']}";
}
} else {
continue;
}
Expand Down

0 comments on commit a31a0a4

Please sign in to comment.