The NetSync Monitor protocol features a TLV with a length of zero. Our input message parsing assumes that every TLV will have some sort of payload, and up until now this was true. This patch adjusts the parsing code to accept TLVs of length zero.
Signed-off-by: Richard Cochran <richardcoch...@gmail.com> --- msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msg.c b/msg.c index 4b3d926..11ee730 100644 --- a/msg.c +++ b/msg.c @@ -126,7 +126,7 @@ static int suffix_post_recv(uint8_t *ptr, int len, struct tlv_extra *last) if (!ptr) return 0; - for (cnt = 0; len > sizeof(struct TLV); cnt++) { + for (cnt = 0; len >= sizeof(struct TLV); cnt++) { tlv = (struct TLV *) ptr; tlv->type = ntohs(tlv->type); tlv->length = ntohs(tlv->length); -- 2.11.0 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel