For various opaque LSAs, not only is the value of the TLV a "may
repeat", the TLVs *themselves* may repeat.
Also, pass a pointer to the TLV to ospf_print_grace_lsa() and
ospf_print_te_lsa(), rather than a pointer to the type field, as they
dissect a sequence of TLVs.
Hopefully, that will address Coverity CID
1426916,
1426917, and
1426920.
nd_uint16_t type;
nd_uint16_t length;
nd_byte data[1]; /* may repeat */
nd_uint16_t type;
nd_uint16_t length;
nd_byte data[1]; /* may repeat */
+ } un_te_lsa_tlv[1]; /* may repeat */
/* Opaque Grace LSA */
struct {
nd_uint16_t type;
nd_uint16_t length;
nd_byte data[1]; /* may repeat */
/* Opaque Grace LSA */
struct {
nd_uint16_t type;
nd_uint16_t length;
nd_byte data[1]; /* may repeat */
+ } un_grace_tlv[1]; /* may repeat */
/* Opaque Router information LSA */
struct {
nd_uint16_t type;
nd_uint16_t length;
nd_byte data[1]; /* may repeat */
/* Opaque Router information LSA */
struct {
nd_uint16_t type;
nd_uint16_t length;
nd_byte data[1]; /* may repeat */
+ } un_ri_tlv[1]; /* may repeat */
/* Unknown LSA */
struct unknown {
/* Unknown LSA */
struct unknown {
switch (EXTRACT_U_1(lsap->ls_hdr.un_lsa_id.opaque_field.opaque_type)) {
case LS_OPAQUE_TYPE_RI:
switch (EXTRACT_U_1(lsap->ls_hdr.un_lsa_id.opaque_field.opaque_type)) {
case LS_OPAQUE_TYPE_RI:
- tptr = (const uint8_t *)(&lsap->lsa_un.un_ri_tlv.type);
+ tptr = (const uint8_t *)(lsap->lsa_un.un_ri_tlv);
while (ls_length != 0) {
ND_TCHECK_4(tptr);
while (ls_length != 0) {
ND_TCHECK_4(tptr);
break;
case LS_OPAQUE_TYPE_GRACE:
break;
case LS_OPAQUE_TYPE_GRACE:
- if (ospf_print_grace_lsa(ndo, (const uint8_t *)(&lsap->lsa_un.un_grace_tlv.type),
+ if (ospf_print_grace_lsa(ndo, (const uint8_t *)(lsap->lsa_un.un_grace_tlv),
ls_length) == -1) {
return(ls_end);
}
break;
case LS_OPAQUE_TYPE_TE:
ls_length) == -1) {
return(ls_end);
}
break;
case LS_OPAQUE_TYPE_TE:
- if (ospf_print_te_lsa(ndo, (const uint8_t *)(&lsap->lsa_un.un_te_lsa_tlv.type),
+ if (ospf_print_te_lsa(ndo, (const uint8_t *)(lsap->lsa_un.un_te_lsa_tlv),
ls_length) == -1) {
return(ls_end);
}
ls_length) == -1) {
return(ls_end);
}