Skip to content

Commit

Permalink
Merge pull request #6240 from ton31337/fix/null_bnc_bgp_show_hostname
Browse files Browse the repository at this point in the history
bgpd: Add a sanitify check for bgp_nexthop_cache against NULL
  • Loading branch information
srimohans authored Apr 17, 2020
2 parents a83014c + eb91f8d commit bece779
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -7544,7 +7544,7 @@ static char *bgp_nexthop_hostname(struct peer *peer,
struct bgp_nexthop_cache *bnc)
{
if (peer->hostname
&& CHECK_FLAG(peer->bgp->flags, BGP_FLAG_SHOW_HOSTNAME)
&& CHECK_FLAG(peer->bgp->flags, BGP_FLAG_SHOW_HOSTNAME) && bnc
&& CHECK_FLAG(bnc->flags, BGP_NEXTHOP_CONNECTED))
return peer->hostname;
return NULL;
Expand Down

0 comments on commit bece779

Please sign in to comment.