bgpd: peer->bgp must be non NULL

We lock and set peer->bgp at peer creation and only
remove it at deletion.  Therefore these tests are
not needed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2018-03-20 19:02:19 -04:00
parent c8f573499a
commit 5410015a79
3 changed files with 3 additions and 3 deletions

View File

@ -101,7 +101,7 @@ static void bgp_bfd_peer_sendmsg(struct peer *peer, int command)
bfd_info = (struct bfd_info *)peer->bfd_info;
if (peer->bgp && (peer->bgp->inst_type == BGP_INSTANCE_TYPE_VRF))
if (peer->bgp->inst_type == BGP_INSTANCE_TYPE_VRF)
vrf_id = peer->bgp->vrf_id;
if (command == ZEBRA_BFD_DEST_DEREGISTER) {

View File

@ -1377,7 +1377,7 @@ int bgp_start(struct peer *peer)
return 0;
}
if (peer->bgp && peer->bgp->vrf_id == VRF_UNKNOWN) {
if (peer->bgp->vrf_id == VRF_UNKNOWN) {
if (bgp_debug_neighbor_events(peer))
zlog_err(
"%s [FSM] In a VRF that is not initialised yet",

View File

@ -389,7 +389,7 @@ int bgp_generate_updgrp_packets(struct thread *thread)
if (peer->status != Established)
return 0;
if (peer->bgp && peer->bgp->main_peers_update_hold)
if (peer->bgp->main_peers_update_hold)
return 0;
do {