ospf6d: fix broken indentation in "show ipv6 ospf6 neighbor"

In the State/IfState column, we were reserving only 6 characters to
print the state of each neighbor, but this is not enough for cases like
"Loading" (7 characters) and "ExChange" (8 characters). Increase the
width of this field to 8 to fix the broken indendation.

ospf6d's output before this patch:
ubuntu# show ipv6 ospf6 neighbor
Neighbor ID     Pri    DeadTime  State/IfState         Duration I/F[State]
2.2.2.2           1    00:00:35 ExChange/DR              00:01:15 rt1-eth0[BDR]
3.3.3.3           1    00:00:35 Loading/DR              00:01:15 rt1-eth1[BDR]
4.4.4.4           1    00:00:35   Full/DR              00:01:15 rt1-eth2[BDR]
5.5.5.5           1    00:00:35   None/DR              00:01:10 rt1-eth3[BDR]
6.6.6.6           1    00:00:35   Down/DR              00:01:15 rt1-eth4[BDR]
7.7.7.7           1    00:00:35 Attempt/DR              00:01:15 rt1-eth5[BDR]
8.8.8.8           1    00:00:35   Init/DR              00:01:10 rt1-eth6[BDR]
9.9.9.9           1    00:00:35 Twoway/DR              00:01:14 rt1-eth7[BDR]
10.10.10.10       1    00:00:35 ExStart/DR              00:01:10 rt1-eth8[BDR]

ospf6d's output with this patch:
ubuntu# show ipv6 ospf6 neighbor
Neighbor ID     Pri    DeadTime    State/IfState         Duration I/F[State]
2.2.2.2           1    00:00:36 ExChange/DR              00:00:44 rt1-eth0[BDR]
3.3.3.3           1    00:00:36  Loading/DR              00:00:39 rt1-eth1[BDR]
4.4.4.4           1    00:00:35     Full/DR              00:00:39 rt1-eth2[BDR]
5.5.5.5           1    00:00:36     None/DR              00:00:44 rt1-eth3[BDR]
6.6.6.6           1    00:00:36     Down/DR              00:00:39 rt1-eth4[BDR]
7.7.7.7           1    00:00:36  Attempt/DR              00:00:39 rt1-eth5[BDR]
8.8.8.8           1    00:00:36     Init/DR              00:00:39 rt1-eth6[BDR]
9.9.9.9           1    00:00:35   Twoway/DR              00:00:40 rt1-eth7[BDR]
10.10.10.10       1    00:00:36  ExStart/DR              00:00:39 rt1-eth8[BDR]

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
Renato Westphal 2016-12-19 14:43:25 -02:00
parent 07bc383384
commit 6bfae35e5c

View File

@ -682,7 +682,7 @@ ospf6_neighbor_show (struct vty *vty, struct ospf6_neighbor *on)
"I/F", "State", VNL);
*/
vty_out (vty, "%-15s %3d %11s %6s/%-12s %11s %s[%s]%s",
vty_out (vty, "%-15s %3d %11s %8s/%-12s %11s %s[%s]%s",
router_id, on->priority, deadtime,
ospf6_neighbor_state_str[on->state], nstate, duration,
on->ospf6_if->interface->name,
@ -711,7 +711,7 @@ ospf6_neighbor_show_drchoice (struct vty *vty, struct ospf6_neighbor *on)
timersub (&now, &on->last_changed, &res);
timerstring (&res, duration, sizeof (duration));
vty_out (vty, "%-15s %6s/%-11s %-15s %-15s %s[%s]%s",
vty_out (vty, "%-15s %8s/%-11s %-15s %-15s %s[%s]%s",
router_id, ospf6_neighbor_state_str[on->state],
duration, drouter, bdrouter, on->ospf6_if->interface->name,
ospf6_interface_state_str[on->ospf6_if->state],
@ -856,11 +856,11 @@ DEFUN (show_ipv6_ospf6_neighbor,
}
if (showfunc == ospf6_neighbor_show)
vty_out (vty, "%-15s %3s %11s %6s/%-12s %11s %s[%s]%s",
vty_out (vty, "%-15s %3s %11s %8s/%-12s %11s %s[%s]%s",
"Neighbor ID", "Pri", "DeadTime", "State", "IfState", "Duration",
"I/F", "State", VNL);
else if (showfunc == ospf6_neighbor_show_drchoice)
vty_out (vty, "%-15s %6s/%-11s %-15s %-15s %s[%s]%s",
vty_out (vty, "%-15s %8s/%-11s %-15s %-15s %s[%s]%s",
"RouterID", "State", "Duration", "DR", "BDR", "I/F",
"State", VNL);