Cleanup calls where we were passing in the su for
peer creation a tiny bit.
Creating a peer from the cli will always have a conf_if *or*
a su but not both. While a doppelganger will have both.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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 = peer_lookup_by_conf_if(bgp, conf_if);
if (peer) {
if (as_str)
- ret = peer_remote_as(bgp, &su, conf_if, &as, as_type,
+ ret = peer_remote_as(bgp, NULL, conf_if, &as, as_type,
afi, safi);
} else {
if (bgp_flag_check(bgp, BGP_FLAG_NO_DEFAULT_IPV4)
if (peer->host)
XFREE(MTYPE_BGP_PEER_HOST, peer->host);
peer->host = XSTRDUP(MTYPE_BGP_PEER_HOST, conf_if);
+ if (su)
+ peer->su = *su;
} else if (su) {
peer->su = *su;
sockunion2str(su, buf, SU_ADDRSTRLEN);