Merge pull request #2743 from donaldsharp/bgp_null_stuff

Put back some removed Code
This commit is contained in:
Lou Berger 2018-07-27 12:45:08 -04:00 committed by GitHub
commit 729fa7048b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -188,7 +188,7 @@ static void bgp_info_extra_free(struct bgp_info_extra **extra)
struct bgp_info *bi = (struct bgp_info *)e->parent;
if (bi->net)
bgp_unlock_node((struct bgp_node *)bi->net);
bi->net = bgp_unlock_node((struct bgp_node *)bi->net);
bgp_info_unlock(e->parent);
e->parent = NULL;
}

View File

@ -128,9 +128,9 @@ static inline struct bgp_node *bgp_node_parent_nolock(struct bgp_node *node)
/*
* bgp_unlock_node
*/
static inline void bgp_unlock_node(struct bgp_node *node)
static inline struct bgp_node *bgp_unlock_node(struct bgp_node *node)
{
route_unlock_node(bgp_node_to_rnode(node));
return (struct bgp_node *)route_unlock_node(bgp_node_to_rnode(node));
}
/*

View File

@ -233,13 +233,17 @@ static inline struct route_node *route_lock_node(struct route_node *node)
}
/* Unlock node. */
static inline void route_unlock_node(struct route_node *node)
static inline struct route_node *route_unlock_node(struct route_node *node)
{
assert(node->lock > 0);
(*(unsigned *)&node->lock)--;
if (node->lock == 0)
if (node->lock == 0) {
route_node_delete(node);
return NULL;
}
return node;
}
/*