Merge pull request #13970 from ton31337/fix/bgpd_tunnel_encap_attr

bgpd: Get 1 or 2 octets for Sub-TLV length (Tunnel Encap attr)
This commit is contained in:
Russ White 2023-07-11 10:09:25 -04:00 committed by GitHub
commit 49bf7b319f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2658,7 +2658,9 @@ static int bgp_attr_encap(uint8_t type, struct peer *peer, /* IN */
if (BGP_ATTR_ENCAP == type) { if (BGP_ATTR_ENCAP == type) {
subtype = stream_getc(BGP_INPUT(peer)); subtype = stream_getc(BGP_INPUT(peer));
sublength = stream_getc(BGP_INPUT(peer)); sublength = (subtype < 128)
? stream_getc(BGP_INPUT(peer))
: stream_getw(BGP_INPUT(peer));
length -= 2; length -= 2;
#ifdef ENABLE_BGP_VNC #ifdef ENABLE_BGP_VNC
} else { } else {