mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-27 03:33:43 +00:00
bgpd: Adjust the length of tunnel encap sub-tlv by sub-tlv type
Fixes:79563af564
("bgpd: Get 1 or 2 octets for Sub-TLV length (Tunnel Encap attr)") Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit34b209f0ae
)
This commit is contained in:
parent
48b0d338e3
commit
c105f9acd9
@ -2728,10 +2728,13 @@ static int bgp_attr_encap(struct bgp_attr_parser_args *args)
|
||||
|
||||
if (BGP_ATTR_ENCAP == type) {
|
||||
subtype = stream_getc(BGP_INPUT(peer));
|
||||
sublength = (subtype < 128)
|
||||
? stream_getc(BGP_INPUT(peer))
|
||||
: stream_getw(BGP_INPUT(peer));
|
||||
length -= 2;
|
||||
if (subtype < 128) {
|
||||
sublength = stream_getc(BGP_INPUT(peer));
|
||||
length -= 2;
|
||||
} else {
|
||||
sublength = stream_getw(BGP_INPUT(peer));
|
||||
length -= 3;
|
||||
}
|
||||
#ifdef ENABLE_BGP_VNC
|
||||
} else {
|
||||
subtype = stream_getw(BGP_INPUT(peer));
|
||||
|
Loading…
Reference in New Issue
Block a user