]> git.puffer.fish Git - matthieu/frr.git/commit
ospfd: fix show ospf neigh json for multile nbrs
authorChirag Shah <chirag@cumulusnetworks.com>
Mon, 30 Oct 2017 18:56:59 +0000 (11:56 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Tue, 31 Oct 2017 02:31:28 +0000 (19:31 -0700)
commitcef262c34a4c8c3ca85ea009d45d41a85d2d7453
tree2509540c76f420466312f4714c5582fc1f20f5ef
parentb1c3ae8ce33dff980cc5008c939776327f9b9f11
ospfd: fix show ospf neigh json for multile nbrs

Same neighbor learned from multiple ospf interfaces
(all) were not displayed in json, only last was displayed.
Created list within dictionary using neighbor-id as key.
lookup neigbhor-id in json obejct prior to creating new list.

spine-2# show ip ospf neighbor

Neighbor ID   Pri State     Dead Time Address     Interface
0.0.1.16        1 Full/DR   36.754s   8.0.3.15    swp1:8.0.3.16
0.0.1.16        1 Full/DR   30.903s   7.0.3.15    swp2:7.0.3.16

spine-2# show ip ospf neighbor json
{
   "0.0.1.16":[
   {
      "priority":1,
         "state":"Full\/DR",
         "deadTimeMsecs":35114,
         "address":"8.0.3.15",
         "ifaceName":"swp1:8.0.3.16",
         "retransmitCounter":0,
         "requestCounter":0,
         "dbSummaryCounter":0
   },
   {
      "priority":1,
      "state":"Full\/DR",
      "deadTimeMsecs":39264,
      "address":"7.0.3.15",
      "ifaceName":"swp2:7.0.3.16",
      "retransmitCounter":0,
      "requestCounter":0,
      "dbSummaryCounter":0
   }
   ]
}

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
ospfd/ospf_vty.c