diff options
Diffstat (limited to 'src/plugins/cdp/cdp_input.c')
-rw-r--r-- | src/plugins/cdp/cdp_input.c | 19 |
1 files changed, 12 insertions, 7 deletions
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; } |