From: Fredi Raspall Date: Wed, 2 May 2018 14:30:26 +0000 (+0200) Subject: bgpd/bgp_zebra.c: Fix process of label-chunk msg X-Git-Tag: frr-6.1-dev~440^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=aec865e4164525cdb43daff79ad79932829ee56e;p=matthieu%2Ffrr.git bgpd/bgp_zebra.c: Fix process of label-chunk msg All messages to/from the label manager include two additional fields: protocol and instance. This patch fixes the parsing of label chunks response used by BGPd, which did not consider the two fields. Signed-off-by: Fredi Raspall --- diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 1c32291740..9e033c6309 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -2027,12 +2027,25 @@ static void bgp_zebra_process_label_chunk( uint8_t response_keep; uint32_t first; uint32_t last; + uint8_t proto; + unsigned short instance; s = zclient->ibuf; + STREAM_GETC(s, proto); + STREAM_GETW(s, instance); STREAM_GETC(s, response_keep); STREAM_GETL(s, first); STREAM_GETL(s, last); + if (zclient->redist_default != proto) { + zlog_err("Got LM msg with wrong proto %u", proto); + return; + } + if (zclient->instance != instance) { + zlog_err("Got LM msg with wrong instance %u", proto); + return; + } + if (first > last || first < MPLS_LABEL_UNRESERVED_MIN || last > MPLS_LABEL_UNRESERVED_MAX) {