BGP: Compliance with RFC8203bis

This commit is contained in:
Alexander Azimov 2019-04-30 13:55:43 +02:00 committed by Ondrej Zajicek (work)
parent 0b1e1e1a00
commit 7ff34ca2cb
2 changed files with 2 additions and 2 deletions

View file

@ -1611,7 +1611,7 @@ bgp_shutdown(struct proto *P)
if (message)
{
uint msg_len = strlen(message);
msg_len = MIN(msg_len, 128);
msg_len = MIN(msg_len, 255);
/* Buffer will be freed automatically by protocol shutdown */
data = mb_alloc(p->p.pool, msg_len + 1);

View file

@ -2893,7 +2893,7 @@ bgp_handle_message(struct bgp_proto *p, byte *data, uint len, byte **bp)
return 1;
/* Handle proper message */
if ((msg_len > 128) && (msg_len + 1 > len))
if ((msg_len > 255) && (msg_len + 1 > len))
return 0;
/* Some elementary cleanup */