Make sure we match the right SPI to src and dst address, otherwise the purge of the old

spi fails.
This commit is contained in:
Seth Mos 2009-01-16 08:28:27 +00:00
parent bf92bc791d
commit 2c64a07a65

View File

@ -1260,10 +1260,10 @@ function reload_tunnel_spd_policy($tunnel, $oldtunnel) {
/* zap any existing SA entries beforehand */
foreach($sad_arr as $sad) {
if(($sad['dst'] == $ep) && ($sad['src'] == $rgip)) {
$spdconf .= "delete {$ep} {$rgip} {$tunnel['p2']['protocol']} 0x{$sad['spi']};\n";
$spdconf .= "delete {$rgip} {$ep} {$tunnel['p2']['protocol']} 0x{$sad['spi']};\n";
}
if(($sad['src'] == $ep) && ($sad['dst'] == $rgip)) {
$spdconf .= "delete {$rgip} {$ep} {$tunnel['p2']['protocol']} 0x{$sad['spi']};\n";
$spdconf .= "delete {$ep} {$rgip} {$tunnel['p2']['protocol']} 0x{$sad['spi']};\n";
}
}
/* add new SPD policies to replace them */