mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
pfSense - Bug #3607: Fix issue whereby the ICMP6 messages sometimes have the wrong source IP when a monitor gateway has been set.
This commit is contained in:
parent
8c7e38ff68
commit
dd8d9bdcaa
@ -185,14 +185,30 @@ EOD;
|
||||
" " . escapeshellarg($gateway['gateway']), true);
|
||||
}
|
||||
} else if ($gateway['ipprotocol'] == "inet6") { // This is an IPv6 gateway...
|
||||
/* link locals really need a different src ip */
|
||||
if(is_linklocal($gateway['gateway'])) {
|
||||
$gwifip = find_interface_ipv6_ll($gateway['interface'], true);
|
||||
if ($gateway['monitor'] == $gateway['gateway']) {
|
||||
/* link locals really need a different src ip */
|
||||
if (is_linklocal($gateway['gateway'])) {
|
||||
$gwifip = find_interface_ipv6_ll($gateway['interface'], true);
|
||||
} else {
|
||||
$gwifip = find_interface_ipv6($gateway['interface'], true);
|
||||
}
|
||||
} else {
|
||||
/* '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...
|
||||
*/
|
||||
$gwifip = find_interface_ipv6($gateway['interface'], true);
|
||||
if (is_linklocal($gateway['monitor'])) {
|
||||
if (!strstr($gateway['monitor'], '%')) {
|
||||
$gateway['monitor'] .= "%{$gateway['interface']}";
|
||||
}
|
||||
} else {
|
||||
// Monitor is a routable address, so use a routable address for the "src" part
|
||||
$gwifip = find_interface_ipv6($gateway['interface'], true);
|
||||
}
|
||||
}
|
||||
if (is_linklocal($gateway['monitor']) && !strstr($gateway['monitor'], '%'))
|
||||
$gateway['monitor'] .= "%{$gateway['interface']}";
|
||||
|
||||
if (!is_ipaddrv6($gwifip))
|
||||
continue; //Skip this target
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user