bgpd: fix crash in bgp_stop due to missing vrf

Problem found to be derefencing a vrf that had already been deleted.  Fix
verifies that vrf exists before using it.

Ticket: CM-13682
Signed-off-by: Don Slice
Reviewed By: Vivek Venkatraman
Testing Done: manual testing, re-run of failing scripts good
This commit is contained in:
Don Slice 2016-11-22 09:48:16 -08:00
parent d32dfc2201
commit 2e37f307ee

View File

@ -1026,7 +1026,7 @@ bgp_stop (struct peer *peer)
zlog_info ("%%ADJCHANGE: neighbor %s(%s) in vrf %s Down %s",
peer->host,
(peer->hostname) ? peer->hostname : "Unknown",
(vrf->vrf_id != VRF_DEFAULT) ? vrf->name : "Default",
vrf ? ((vrf->vrf_id != VRF_DEFAULT) ? vrf->name : "Default") : "",
peer_down_str [(int) peer->last_reset]);
}