Merge pull request #3644 from opensourcerouting/ldpd-pdu-length-fix

ldpd: fix corner case in which we wouldn't respect the max pdu length
This commit is contained in:
Donald Sharp 2019-01-22 20:08:22 -05:00 committed by GitHub
commit 6bb2950fb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,7 @@ enqueue_pdu(struct nbr *nbr, uint16_t type, struct ibuf *buf, uint16_t size)
struct ldp_hdr *ldp_hdr;
ldp_hdr = ibuf_seek(buf, 0, sizeof(struct ldp_hdr));
ldp_hdr->length = htons(size);
ldp_hdr->length = htons(size - LDP_HDR_DEAD_LEN);
evbuf_enqueue(&nbr->tcp->wbuf, buf);
}
@ -65,7 +65,7 @@ send_labelmessage(struct nbr *nbr, uint16_t type, struct mapping_head *mh)
/* real size will be set up later */
err |= gen_ldp_hdr(buf, 0);
size = LDP_HDR_PDU_LEN;
size = LDP_HDR_SIZE;
first = 0;
}