mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 11:25:41 +00:00
bgpd: Increase administrative shutdown message size to 255
Extended BGP Administrative Shutdown Communication (rfc9003): Basically, shutdown message size is increased to 255 from 128. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
parent
541b51a5a3
commit
9f33eea39a
@ -509,7 +509,7 @@ const char *bgp_notify_admin_message(char *buf, size_t bufsz, uint8_t *data,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
uint8_t len = data[0];
|
uint8_t len = data[0];
|
||||||
if (len > 128 || len > datalen - 1)
|
if (!len || len > datalen - 1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return zlog_sanitize(buf, bufsz, data + 1, len);
|
return zlog_sanitize(buf, bufsz, data + 1, len);
|
||||||
|
@ -4272,17 +4272,16 @@ static void peer_flag_modify_action(struct peer *peer, uint32_t flag)
|
|||||||
if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->status)) {
|
if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->status)) {
|
||||||
char *msg = peer->tx_shutdown_message;
|
char *msg = peer->tx_shutdown_message;
|
||||||
size_t msglen;
|
size_t msglen;
|
||||||
|
uint8_t msgbuf[BGP_ADMIN_SHUTDOWN_MSG_LEN + 1];
|
||||||
|
|
||||||
if (!msg && peer_group_active(peer))
|
if (!msg && peer_group_active(peer))
|
||||||
msg = peer->group->conf
|
msg = peer->group->conf
|
||||||
->tx_shutdown_message;
|
->tx_shutdown_message;
|
||||||
msglen = msg ? strlen(msg) : 0;
|
msglen = msg ? strlen(msg) : 0;
|
||||||
if (msglen > 128)
|
if (msglen > BGP_ADMIN_SHUTDOWN_MSG_LEN)
|
||||||
msglen = 128;
|
msglen = BGP_ADMIN_SHUTDOWN_MSG_LEN;
|
||||||
|
|
||||||
if (msglen) {
|
if (msglen) {
|
||||||
uint8_t msgbuf[129];
|
|
||||||
|
|
||||||
msgbuf[0] = msglen;
|
msgbuf[0] = msglen;
|
||||||
memcpy(msgbuf + 1, msg, msglen);
|
memcpy(msgbuf + 1, msg, msglen);
|
||||||
|
|
||||||
|
@ -1731,6 +1731,9 @@ struct bgp_nlri {
|
|||||||
/* Default BGP port number. */
|
/* Default BGP port number. */
|
||||||
#define BGP_PORT_DEFAULT 179
|
#define BGP_PORT_DEFAULT 179
|
||||||
|
|
||||||
|
/* Extended BGP Administrative Shutdown Communication */
|
||||||
|
#define BGP_ADMIN_SHUTDOWN_MSG_LEN 255
|
||||||
|
|
||||||
/* BGP minimum message size. */
|
/* BGP minimum message size. */
|
||||||
#define BGP_MSG_OPEN_MIN_SIZE (BGP_HEADER_SIZE + 10)
|
#define BGP_MSG_OPEN_MIN_SIZE (BGP_HEADER_SIZE + 10)
|
||||||
#define BGP_MSG_UPDATE_MIN_SIZE (BGP_HEADER_SIZE + 4)
|
#define BGP_MSG_UPDATE_MIN_SIZE (BGP_HEADER_SIZE + 4)
|
||||||
|
Loading…
Reference in New Issue
Block a user