diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-01-22 20:08:22 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-22 20:08:22 -0500 |
| commit | 6bb2950fb6dde13efc51a86745a305205bbb1505 (patch) | |
| tree | d88cfc091d90e4d06698e109d2aeda99413240ca | |
| parent | ed98b97622d1d3967f34d527ed3a09335eda5c96 (diff) | |
| parent | 2d2011708dcc6c01ea3a7b0885b7d1e2e6458872 (diff) | |
Merge pull request #3644 from opensourcerouting/ldpd-pdu-length-fix
ldpd: fix corner case in which we wouldn't respect the max pdu length
| -rw-r--r-- | ldpd/labelmapping.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ldpd/labelmapping.c b/ldpd/labelmapping.c index 944f93331f..5e1b422a41 100644 --- a/ldpd/labelmapping.c +++ b/ldpd/labelmapping.c @@ -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; } |
