msg: Allow zero length TLVs.
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 <richardcochran@gmail.com>master
parent
a003b4c36e
commit
613f005996
2
msg.c
2
msg.c
|
@ -190,7 +190,7 @@ static int suffix_post_recv(struct ptp_message *msg, uint8_t *ptr, int len)
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
while (len > sizeof(struct TLV)) {
|
while (len >= sizeof(struct TLV)) {
|
||||||
extra = tlv_extra_alloc();
|
extra = tlv_extra_alloc();
|
||||||
if (!extra) {
|
if (!extra) {
|
||||||
pr_err("failed to allocate TLV descriptor");
|
pr_err("failed to allocate TLV descriptor");
|
||||||
|
|
Loading…
Reference in New Issue