mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 13:13:08 +00:00
bgpd: null check (Coverity 1399270)
Signed-off-by: F. Aragon <paco@voltanet.io>
This commit is contained in:
parent
9eafc8abd7
commit
cc32742c09
@ -102,6 +102,7 @@ struct community_list_handler *bgp_clist;
|
|||||||
unsigned int multipath_num = MULTIPATH_NUM;
|
unsigned int multipath_num = MULTIPATH_NUM;
|
||||||
|
|
||||||
static void bgp_if_finish(struct bgp *bgp);
|
static void bgp_if_finish(struct bgp *bgp);
|
||||||
|
static void peer_drop_dynamic_neighbor(struct peer *peer);
|
||||||
|
|
||||||
extern struct zclient *zclient;
|
extern struct zclient *zclient;
|
||||||
|
|
||||||
@ -3718,10 +3719,10 @@ struct peer *peer_lookup_dynamic_neighbor(struct bgp *bgp, union sockunion *su)
|
|||||||
return peer;
|
return peer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void peer_drop_dynamic_neighbor(struct peer *peer)
|
static void peer_drop_dynamic_neighbor(struct peer *peer)
|
||||||
{
|
{
|
||||||
int dncount = -1;
|
int dncount = -1;
|
||||||
if (peer->group && peer->group->bgp) {
|
if (peer->group->bgp) {
|
||||||
dncount = peer->group->bgp->dynamic_neighbors_count;
|
dncount = peer->group->bgp->dynamic_neighbors_count;
|
||||||
if (dncount)
|
if (dncount)
|
||||||
peer->group->bgp->dynamic_neighbors_count = --dncount;
|
peer->group->bgp->dynamic_neighbors_count = --dncount;
|
||||||
@ -3731,7 +3732,6 @@ void peer_drop_dynamic_neighbor(struct peer *peer)
|
|||||||
peer->group->name, dncount);
|
peer->group->name, dncount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* If peer is configured at least one address family return 1. */
|
/* If peer is configured at least one address family return 1. */
|
||||||
int peer_active(struct peer *peer)
|
int peer_active(struct peer *peer)
|
||||||
{
|
{
|
||||||
|
@ -1462,7 +1462,6 @@ extern struct peer_group *peer_group_lookup_dynamic_neighbor(struct bgp *,
|
|||||||
struct prefix **);
|
struct prefix **);
|
||||||
extern struct peer *peer_lookup_dynamic_neighbor(struct bgp *,
|
extern struct peer *peer_lookup_dynamic_neighbor(struct bgp *,
|
||||||
union sockunion *);
|
union sockunion *);
|
||||||
extern void peer_drop_dynamic_neighbor(struct peer *);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Peers are incredibly easy to memory leak
|
* Peers are incredibly easy to memory leak
|
||||||
|
Loading…
Reference in New Issue
Block a user