From 464598de53722b515c0967eb223aa538bb27ecf6 Mon Sep 17 00:00:00 2001 From: Daniel Walton Date: Tue, 16 May 2017 23:54:46 +0000 Subject: [PATCH] bgpd: "neighbor swpX interface remote-as XYZ" is ignored Signed-off-by: Daniel Walton Reviewed-by: Don Slice If you did: neighbor swp1 interface neighbor swp1 interface remote-as external we would not set the remote-as. You could however still do neighbor swp1 remote-as external --- bgpd/bgp_vty.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 347d026aff..f163fef712 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -2872,7 +2872,12 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi, } peer = peer_lookup_by_conf_if (bgp, conf_if); - if (!peer) + if (peer) + { + if (as_str) + ret = peer_remote_as (bgp, &su, NULL, &as, as_type, afi, safi); + } + else { if (bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4) && afi == AFI_IP && safi == SAFI_UNICAST) @@ -2896,8 +2901,9 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi, } peer_flag_set (peer, PEER_FLAG_CAPABILITY_ENHE); } - else if ((v6only && !CHECK_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY)) || - (!v6only && CHECK_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY))) + + if ((v6only && !CHECK_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY)) || + (!v6only && CHECK_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY))) { if (v6only) SET_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY); -- 2.39.5