]> git.baikalelectronics.ru Git - kernel.git/commit
ptp: fix L2 event message recognition
authorRichard Cochran <richardcochran@gmail.com>
Tue, 20 Sep 2011 01:25:41 +0000 (01:25 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Sep 2011 04:32:03 +0000 (00:32 -0400)
commita6851cc0cfcc12df9da1fae30588eb05bc60555f
tree3afabb028c1436d50ba0800628207fe5780d7f97
parent1cc5d61820335f3ef6c14a19b951f4c3f70cdeba
ptp: fix L2 event message recognition

The IEEE 1588 standard defines two kinds of messages, event and general
messages. Event messages require time stamping, and general do not. When
using UDP transport, two separate ports are used for the two message
types.

The BPF designed to recognize event messages incorrectly classifies L2
general messages as event messages. This commit fixes the issue by
extending the filter to check the message type field for L2 PTP packets.
Event messages are be distinguished from general messages by testing
the "general" bit.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Cc: <stable@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/ptp_classify.h