diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-10-07 19:54:07 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-10-07 20:55:52 -0400 |
| commit | cc4d4ce8229d6107599eb42d4f646eddbea5ddc7 (patch) | |
| tree | 05ab2232b611932f2e422f417e7c149f7dbed761 | |
| parent | 825d98347d8993fb2f7debefdaa5eabbceec996c (diff) | |
bgpd: Cleanup peer->su handling
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>
| -rw-r--r-- | bgpd/bgp_network.c | 1 | ||||
| -rw-r--r-- | bgpd/bgp_vty.c | 2 | ||||
| -rw-r--r-- | bgpd/bgpd.c | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index d56fdd75ce..191b1641b2 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -406,7 +406,6 @@ static int 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); diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 58f23fd2f4..f617c9f997 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -2835,7 +2835,7 @@ static int peer_conf_interface_get(struct vty *vty, const char *conf_if, 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) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 0300485e91..ebaa0a3e5f 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -1439,6 +1439,8 @@ struct peer *peer_create(union sockunion *su, const char *conf_if, 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); |
