* Change:
+ Add a compile-time option to restore pre-0.9.2 JSON format (when
using json-c). Use `--enable-json0` to enable this option.
+ * Fix:
+ + Correctly parse LLDP-MED civic address when the length of the
+ TLV exceeds the length of the address.
lldpd (0.9.5)
* Change:
return LLDP_MED_LOCFORMAT_COORD;
case LLDP_MED_LOCFORMAT_CIVIC:
if ((m->location->data_len < 3) ||
- (m->location->data_len - 1 !=
+ (m->location->data_len - 1 <
m->location->data[0])) break;
return LLDP_MED_LOCFORMAT_CIVIC;
case LLDP_MED_LOCFORMAT_ELIN:
struct ca_iter *iter = _lldpctl_alloc_in_atom(atom, sizeof(struct ca_iter));
if (!iter) return NULL;
iter->data = (uint8_t*)plist->parent->location->data + 4;
- iter->data_len = plist->parent->location->data_len - 4;
+ iter->data_len = *(uint8_t*)plist->parent->location->data - 3;
return (lldpctl_atom_iter_t*)iter;
}