]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd/bgp_zebra.c: Fix process of label-chunk msg
authorFredi Raspall <fredi@voltanet.io>
Wed, 2 May 2018 14:30:26 +0000 (16:30 +0200)
committerFredi Raspall <fredi@voltanet.io>
Wed, 2 May 2018 14:38:54 +0000 (16:38 +0200)
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 <fredi@voltanet.io>
bgpd/bgp_zebra.c

index 1c3229174049ff1112f7dca7775f03e90a622d0b..9e033c63098c36ecd1b74ca7fb51dac265c3bf93 100644 (file)
@@ -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) {