diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-04-04 12:44:46 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-04-04 12:44:46 -0400 |
| commit | 66e373aec05c7f3353adbc36115b930b9b2ebf8c (patch) | |
| tree | e02745c08c479ad62e53f1969c872650fcaf708d | |
| parent | 77c489986edeaa107c1b201d879bf599fd7be2f6 (diff) | |
bgpd: Another hash_get crash fix
Basically when modifying the peer->su, we must *always*
release the hash and then re-install it, else
we will cause crashes when we go to look up data
that is not going to be there.
Ticket: CM-10212
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
| -rw-r--r-- | bgpd/bgp_network.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index 61986f561b..4cdeaeb7d5 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -32,6 +32,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "linklist.h" #include "network.h" #include "queue.h" +#include "hash.h" #include "bgpd/bgpd.h" #include "bgpd/bgp_open.h" @@ -410,6 +411,8 @@ bgp_accept (struct thread *thread) peer = peer_create (&su, peer1->conf_if, peer1->bgp, peer1->local_as, peer1->as, peer1->as_type, 0, 0, NULL); peer->su = su; + hash_release(peer->bgp->peerhash, peer); + hash_get(peer->bgp->peerhash, peer, hash_alloc_intern); peer_xfer_config(peer, peer1); UNSET_FLAG (peer->flags, PEER_FLAG_CONFIG_NODE); |
