From 2f3e135afab52f2db3cc5fb91815eb5d771de138 Mon Sep 17 00:00:00 2001 From: Manuel Kasper Date: Mon, 9 Aug 2010 15:07:18 +0000 Subject: [PATCH] Fix for multiple entries with the same tag in the knownlinks file (e.g. for LACP). --- README | 4 ++++ www/func.inc | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README b/README index 61f4eb1..4e0cb39 100644 --- a/README +++ b/README @@ -5,6 +5,10 @@ by Manuel Kasper, Monzoon Networks AG 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) diff --git a/www/func.inc b/www/func.inc index 09a2791..1ac8249 100644 --- a/www/func.inc +++ b/www/func.inc @@ -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);