]> 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)
commit314598b1b741a744e8a63f1f6c994062dd75074b
tree3afabb028c1436d50ba0800628207fe5780d7f97
parent767f1fdbfe188badc559bc578dad4516676216f9
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