Make 3 passes at loading the SPD entries as this will fail on large configurations > 250 tunnels

Tested by smos@ 399 tunnels 239 active, ok by sullrich@
This commit is contained in:
Seth Mos 2008-01-14 21:37:47 +00:00
parent 0aeab9f19f
commit abd9c0367f

View File

@ -568,26 +568,29 @@ EOD;
chmod("{$g['varetc_path']}/psk.txt", 0600);
if(is_process_running("racoon")) {
/* flush SPD entries */
mwexec("/sbin/setkey -FP");
// mwexec("/sbin/setkey -F");
$i = 0;
while($i < 2) {
/* load SPD */
mwexec("/bin/cat {$g['varetc_path']}/spd.conf | /usr/local/bin/slowdownpipe.sh | /sbin/setkey -c");
$i++;
}
/* We are already online, reload */
mwexec("/usr/bin/killall -HUP racoon");
// sleep(2);
/* flushie, flushie spds */
} else {
/* flush SA + SPD entries */
mwexec("/sbin/setkey -FP");
mwexec("/sbin/setkey -F");
/* load SPD */
mwexec("/bin/cat {$g['varetc_path']}/spd.conf | /usr/local/bin/slowdownpipe.sh | /sbin/setkey -c");
sleep(1);
} else {
$i = 0;
while($i < 2) {
/* load SPD */
mwexec("/bin/cat {$g['varetc_path']}/spd.conf | /usr/local/bin/slowdownpipe.sh | /sbin/setkey -c");
$i++;
}
/* start racoon */
mwexec("/usr/local/sbin/racoon -f {$g['varetc_path']}/racoon.conf");
/* sleep for a bit */
// sleep (2);
/* flushie, flushie spds */
mwexec("/sbin/setkey -FP");
mwexec("/sbin/setkey -F");
/* load SPD */
mwexec("/bin/cat {$g['varetc_path']}/spd.conf | /usr/local/bin/slowdownpipe.sh | /sbin/setkey -c");
sleep(1);
}
}
}