X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fcdp%2Fcdp_input.c;h=bce8eebe7b04e8d903fdf06c4f597eda6a02520a;hb=40ea3f59dca497e5f4b5a8440a9c8c2e37396701;hp=fa993b84def98b79c417dd44ae255cbde921eb4b;hpb=b023d59d4c67a69e559f265aff3d103207b247ce;p=vpp.git diff --git a/src/plugins/cdp/cdp_input.c b/src/plugins/cdp/cdp_input.c index fa993b84def..bce8eebe7b0 100644 --- a/src/plugins/cdp/cdp_input.c +++ b/src/plugins/cdp/cdp_input.c @@ -276,13 +276,18 @@ cdp_packet_scan (cdp_main_t * cm, cdp_neighbor_t * n) tlv = (cdp_tlv_t *) cur; tlv->t = ntohs (tlv->t); tlv->l = ntohs (tlv->l); - if (tlv->t >= ARRAY_LEN (tlv_handlers)) - return CDP_ERROR_BAD_TLV; - handler = &tlv_handlers[tlv->t]; - fp = handler->process; - e = (*fp) (cm, n, tlv); - if (e) - return e; + /* + * Only process known TLVs. In practice, certain + * devices send tlv->t = 0xFF, perhaps as an EOF of sorts. + */ + if (tlv->t < ARRAY_LEN (tlv_handlers)) + { + handler = &tlv_handlers[tlv->t]; + fp = handler->process; + e = (*fp) (cm, n, tlv); + if (e) + return e; + } /* tlv length includes (t, l) */ cur += tlv->l; }