Fix for multiple entries with the same tag in the knownlinks file (e.g. for LACP).

This commit is contained in:
Manuel Kasper 2010-08-09 15:07:18 +00:00
parent 28f0c03bad
commit 2f3e135afa
2 changed files with 14 additions and 3 deletions

4
README
View File

@ -5,6 +5,10 @@ by Manuel Kasper, Monzoon Networks AG <mkasper@monzoon.net>
Changes
-------
xxx Fix for multiple entries with the same tag in the
knownlinks file (e.g. for LACP)
(contributed by Michal Buchtik)
v1.32 Fix add_ds.sh to support new directory structure
(contributed by Sergei Veltistov)

View File

@ -73,14 +73,21 @@ function getknownlinks() {
continue; /* empty line or comment */
list($routerip,$ifindex,$tag,$descr,$color) = preg_split("/\\t+/", $line);
$knownlinks[] = array(
$known = false;
foreach ($knownlinks as $link) {
if (in_array($tag,$link)) {$known=true;}
}
if (!$known) {
$knownlinks[] = array(
'routerip' => $routerip,
'ifindex' => $ifindex,
'tag' => $tag,
'descr' => $descr,
'color' => $color
);
);
}
}
fclose($fd);