From: Donald Sharp Date: Tue, 20 Mar 2018 23:02:19 +0000 (-0400) Subject: bgpd: peer->bgp must be non NULL X-Git-Tag: frr-5.0-dev~132^2~5 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=5410015a79405ea53517257d443870f9f8bcf9b9;p=mirror_frr.git 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 --- diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index ce46b21f0..91b6929ff 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -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) { diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 3255aff2a..e4a0a1d40 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -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", diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index cb702d80d..d17c33441 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -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 {