@@ -1546,6 +1546,7 @@ def interfaces():
1546
1546
1547
1547
if netifaces .AF_INET6 in ipaddresses :
1548
1548
ifaddresses = []
1549
+ neighbor_info = []
1549
1550
for ipaddr in ipaddresses [netifaces .AF_INET6 ]:
1550
1551
neighbor_name = 'N/A'
1551
1552
neighbor_ip = 'N/A'
@@ -1557,6 +1558,7 @@ def interfaces():
1557
1558
neighbor_ip = bgp_peer [local_ip ][1 ]
1558
1559
except Exception :
1559
1560
pass
1561
+ neighbor_info .append ([neighbor_name , neighbor_ip ])
1560
1562
1561
1563
if len (ifaddresses ) > 0 :
1562
1564
admin = get_if_admin_state (iface )
@@ -1567,9 +1569,11 @@ def interfaces():
1567
1569
master = get_if_master (iface )
1568
1570
if get_interface_mode () == "alias" :
1569
1571
iface = iface_alias_converter .name_to_alias (iface )
1570
- data .append ([iface , master , ifaddresses [0 ][1 ], admin + "/" + oper , neighbor_name , neighbor_ip ])
1571
- for ifaddr in ifaddresses [1 :]:
1572
- data .append (["" , "" , ifaddr [1 ], "" ])
1572
+ data .append ([iface , master , ifaddresses [0 ][1 ], admin + "/" + oper , neighbor_info [0 ][0 ], neighbor_info [0 ][1 ]])
1573
+ neighbor_info .pop (0 )
1574
+ for ifaddr in ifaddresses [1 :]:
1575
+ data .append (["" , "" , ifaddr [1 ], admin + "/" + oper , neighbor_info [0 ][0 ], neighbor_info [0 ][1 ]])
1576
+ neighbor_info .pop (0 )
1573
1577
1574
1578
print tabulate (data , header , tablefmt = "simple" , stralign = 'left' , missingval = "" )
1575
1579
0 commit comments