summaryrefslogtreecommitdiffstats
path: root/eigrpd/eigrp_dump.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2017-08-09 20:46:52 +0200
committerAndrew Lunn <andrew@lunn.ch>2017-08-10 20:25:37 +0200
commit2085179b22a861da6af7b816a0857279c2706ba2 (patch)
tree1bec130c44ebfa68bacad917819c47f952f6e7c2 /eigrpd/eigrp_dump.c
parentMerge pull request #941 from dwalton76/bgpd-peer-group-rebind (diff)
downloadfrr-2085179b22a861da6af7b816a0857279c2706ba2.tar.xz
frr-2085179b22a861da6af7b816a0857279c2706ba2.zip
eigrp: Don't dereference NULL timer in a Neighbour
Current, a eigrp_neighbor only has a t_holddown timer when in state EIGRP_NEIGHBOR_PENDING and EIGRP_NEIGHBOR_UP. In state EIGRP_NEIGHBOR_DOWN it could be a NULL pointer. Don't dereference the timer when dumping the neighbour table without first checking it exists. If it does not exist, display - instead of the remaining time. Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Diffstat (limited to 'eigrpd/eigrp_dump.c')
-rw-r--r--eigrpd/eigrp_dump.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/eigrpd/eigrp_dump.c b/eigrpd/eigrp_dump.c
index db5e38d42..aca6e5981 100644
--- a/eigrpd/eigrp_dump.c
+++ b/eigrpd/eigrp_dump.c
@@ -252,7 +252,10 @@ void show_ip_eigrp_neighbor_sub(struct vty *vty, struct eigrp_neighbor *nbr,
vty_out(vty, "%-3u %-17s %-21s", 0, eigrp_neigh_ip_string(nbr),
eigrp_if_name_string(nbr->ei));
- vty_out(vty, "%-7lu", thread_timer_remain_second(nbr->t_holddown));
+ if (nbr->t_holddown)
+ vty_out(vty, "%-7lu", thread_timer_remain_second(nbr->t_holddown));
+ else
+ vty_out(vty, "- ");
vty_out(vty, "%-8u %-6u %-5u", 0, 0, EIGRP_PACKET_RETRANS_TIME);
vty_out(vty, "%-7lu", nbr->retrans_queue->count);
vty_out(vty, "%u\n", nbr->recv_sequence_number);