diff options
| -rw-r--r-- | bgpd/bgp_vty.c | 10 | ||||
| -rw-r--r-- | bgpd/bgpd.c | 3 | ||||
| -rw-r--r-- | bgpd/bgpd.h | 1 |
3 files changed, 9 insertions, 5 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index bb0be50048..80c8753708 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -6853,7 +6853,7 @@ static int peer_port_vty(struct vty *vty, const char *ip_str, int afi, uint16_t port; struct servent *sp; - peer = peer_lookup_vty(vty, ip_str); + peer = peer_and_group_lookup_vty(vty, ip_str); if (!peer) return CMD_WARNING_CONFIG_FAILED; @@ -6872,9 +6872,9 @@ static int peer_port_vty(struct vty *vty, const char *ip_str, int afi, /* Set specified peer's BGP port. */ DEFUN (neighbor_port, neighbor_port_cmd, - "neighbor <A.B.C.D|X:X::X:X> port (0-65535)", + "neighbor <A.B.C.D|X:X::X:X|WORD> port (0-65535)", NEIGHBOR_STR - NEIGHBOR_ADDR_STR + NEIGHBOR_ADDR_STR2 "Neighbor's BGP port\n" "TCP port number\n") { @@ -6886,10 +6886,10 @@ DEFUN (neighbor_port, DEFUN (no_neighbor_port, no_neighbor_port_cmd, - "no neighbor <A.B.C.D|X:X::X:X> port [(0-65535)]", + "no neighbor <A.B.C.D|X:X::X:X|WORD> port [(0-65535)]", NO_STR NEIGHBOR_STR - NEIGHBOR_ADDR_STR + NEIGHBOR_ADDR_STR2 "Neighbor's BGP port\n" "TCP port number\n") { diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index d6185b246d..bd3e61377a 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -4263,6 +4263,7 @@ static const struct peer_flag_action peer_flag_action_list[] = { {PEER_FLAG_EXTENDED_OPT_PARAMS, 0, peer_change_reset}, {PEER_FLAG_ROLE_STRICT_MODE, 0, peer_change_reset}, {PEER_FLAG_ROLE, 0, peer_change_reset}, + {PEER_FLAG_PORT, 0, peer_change_reset}, {0, 0, 0}}; static const struct peer_flag_action peer_af_flag_action_list[] = { @@ -5450,11 +5451,13 @@ int peer_default_originate_unset(struct peer *peer, afi_t afi, safi_t safi) void peer_port_set(struct peer *peer, uint16_t port) { peer->port = port; + peer_flag_set(peer, PEER_FLAG_PORT); } void peer_port_unset(struct peer *peer) { peer->port = BGP_PORT_DEFAULT; + peer_flag_unset(peer, PEER_FLAG_PORT); } /* Set the TCP-MSS value in the peer structure, diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index a7ac923326..bcb214873f 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -1345,6 +1345,7 @@ struct peer { #define PEER_FLAG_ROLE_STRICT_MODE (1ULL << 31) /* `local-role` configured */ #define PEER_FLAG_ROLE (1ULL << 32) +#define PEER_FLAG_PORT (1ULL << 33) /* *GR-Disabled mode means unset PEER_FLAG_GRACEFUL_RESTART |
