Skip to content

Commit

Permalink
bgpd: bmp bgp asn & router_id coverity fix
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Younsi <[email protected]>
  • Loading branch information
mxyns committed Nov 15, 2023
1 parent 43290b5 commit d6940cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bgpd/bgp_bmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,18 +335,18 @@ static void bmp_per_peer_hdr(struct stream *s, struct bgp *bgp,

/* Peer AS */
/* set peer ASN but for LOC-RIB INSTANCE (RFC 9069) put the local bgp
* ASN if available or 0
* ASN
*/
as_t asn = !is_locrib ? peer->as : bgp ? bgp->as : 0L;
as_t asn = !is_locrib ? peer->as : bgp->as;

stream_putl(s, asn);

/* Peer BGP ID */
/* set router-id but for LOC-RIB INSTANCE (RFC 9069) put the instance
* router-id if available or 0
* router-id
*/
struct in_addr *bgp_id =
!is_locrib ? &peer->remote_id : bgp ? &bgp->router_id : NULL;
!is_locrib ? &peer->remote_id : &bgp->router_id;

stream_put_in_addr(s, bgp_id);

Expand Down

0 comments on commit d6940cc

Please sign in to comment.