r3986 live neighbors page bugfix
authorAlexey Andriyanov <alan@al-an.info>
Tue, 19 Oct 2010 18:48:07 +0000 (18:48 +0000)
committerAlexey Andriyanov <alan@al-an.info>
Tue, 19 Oct 2010 18:48:07 +0000 (18:48 +0000)
inc/gateways.php
inc/interface.php

index 7874091..7cb20c4 100644 (file)
@@ -440,7 +440,7 @@ function ios12ReadLLDPStatus ($input)
                        list ($remote_name, $local_port, $ttl, $caps, $remote_port) = $matches;
                        $local_port = ios12ShortenIfName ($local_port);
                        $remote_port = ios12ShortenIfName ($remote_port);
-                       $ret[$local_port] = array
+                       $ret[$local_port][] = array
                        (
                                'device' => $remote_name,
                                'port' => $remote_port,
index 459e7ee..f4e2b2a 100644 (file)
@@ -8095,8 +8095,19 @@ function renderDiscoveredNeighbors ($object_id)
                                $error_message = "There is an ambiguity between local port media types";
                        elseif (count ($remote_port_ids) > 1)
                                $error_message = "There is an ambiguity between remote port media types";
-                       else // link does not match
-                               $tr_class = "trwarning";
+                       else // no link found
+                       {
+                               $POIFC = getPortOIFCompat();
+                               foreach ($POIFC as $item)
+                                       if ($item['type1'] == $local_port_struct['oif_id'] and $item['type2'] == $remote_port['oif_id'])
+                                       {
+                                               // no link found and ports are compatible, let user create link
+                                               $tr_class = "trwarning";
+                                               break;
+                                       }
+                               if ($tr_class == 'trerror')
+                                       $error_message = "Incompatible port types";
+                       }
 
                        echo "<tr class=\"$tr_class\">";
                        if ($initial_row)