summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2021-07-06 09:41:45 -0400
committerGitHub <noreply@github.com>2021-07-06 09:41:45 -0400
commit4afc3218254264c20b38b32b085b430c34a86c24 (patch)
treebb4e5f24c9106d5d42ea1262cf51a9c78e9f672e
parentaf17728126b76468d70228dbaea9575bd1764a1e (diff)
parent0997ee2611dedd34f709bac742e1c7160e0dbc8f (diff)
Merge pull request #8972 from ton31337/fix/bgp_extended_msg_support
bgpd: Extended message support potential fixes
-rw-r--r--bgpd/bgp_fsm.c1
-rw-r--r--bgpd/bgp_updgrp.c5
-rw-r--r--bgpd/bgpd.c4
3 files changed, 9 insertions, 1 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 4cc096d8e7..79dc0aec9d 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -256,6 +256,7 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
from_peer->last_major_event = last_maj_evt;
peer->remote_id = from_peer->remote_id;
peer->last_reset = from_peer->last_reset;
+ peer->max_packet_size = from_peer->max_packet_size;
peer->peer_gr_present_state = from_peer->peer_gr_present_state;
peer->peer_gr_new_status_flag = from_peer->peer_gr_new_status_flag;
diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c
index b8545188a4..dd3309dad9 100644
--- a/bgpd/bgp_updgrp.c
+++ b/bgpd/bgp_updgrp.c
@@ -339,6 +339,7 @@ static unsigned int updgrp_hash_key_make(const void *p)
key);
key = jhash_1word(peer->v_routeadv, key);
key = jhash_1word(peer->change_local_as, key);
+ key = jhash_1word(peer->max_packet_size, key);
if (peer->group)
key = jhash_1word(jhash(peer->group->name,
@@ -572,6 +573,7 @@ static int update_group_show_walkcb(struct update_group *updgrp, void *arg)
struct update_subgroup *subgrp;
struct peer_af *paf;
struct bgp_filter *filter;
+ struct peer *peer = UPDGRP_PEER(updgrp);
int match = 0;
if (!ctx)
@@ -663,6 +665,9 @@ static int update_group_show_walkcb(struct update_group *updgrp, void *arg)
CHECK_FLAG(subgrp->flags, SUBGRP_FLAG_NEEDS_REFRESH)
? "R"
: "");
+ if (peer)
+ vty_out(vty, " Max packet size: %d\n",
+ peer->max_packet_size);
if (subgrp->peer_count > 0) {
vty_out(vty, " Peers:\n");
SUBGRP_FOREACH_PEER (subgrp, paf)
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 197133cbb4..b861d13fd1 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -1369,7 +1369,7 @@ struct peer *peer_new(struct bgp *bgp)
peer->bgp = bgp_lock(bgp);
peer = peer_lock(peer); /* initial reference */
peer->password = NULL;
- peer->max_packet_size = BGP_MAX_PACKET_SIZE;
+ peer->max_packet_size = BGP_STANDARD_MESSAGE_MAX_PACKET_SIZE;
/* Set default flags. */
FOREACH_AFI_SAFI (afi, safi) {
@@ -1466,6 +1466,8 @@ void peer_xfer_config(struct peer *peer_dst, struct peer *peer_src)
(void)peer_sort(peer_dst);
peer_dst->rmap_type = peer_src->rmap_type;
+ peer_dst->max_packet_size = peer_src->max_packet_size;
+
/* Timers */
peer_dst->holdtime = peer_src->holdtime;
peer_dst->keepalive = peer_src->keepalive;