Re: [Linuxptp-devel] ptp4l wrongly takes padding bytes as TLV?
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Richard C. <ric...@gm...> - 2019-02-01 16:16:51
|
On Fri, Feb 01, 2019 at 10:16:53AM +0000, Vincent Li X wrote: > > Hi Richard, > I mean the change of that two lines to like: > if (cnt < m->header.messageLength || m->header.messageLength < > pdulen) { > pr_debug("wrong length, cnt: %d messageLength: %hu pdulen The rule in communication is to be strict when sending, but generous when receiving. This code generously allows incorrect messageLength. That field is redundant, because all of the transports already provide the packet length. Thus there is no need to check it. If we were using a stream transport like TCP, then checking messageLength would of course be essential. Thanks, Richard |