OSDN Git Service

ptp: fix L2 event message recognition
authorRichard Cochran <richardcochran@gmail.com>
Tue, 20 Sep 2011 01:25:41 +0000 (01:25 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 16 Oct 2011 21:14:53 +0000 (14:14 -0700)
commita94a36c352abcf3c7126b238cfbf9a79314a609b
tree7e25425f8ed760aa32ecd5073f1528ace25163ae
parent416a1b0477b56ac8e7dc3b91d5c18c8da242555c
ptp: fix L2 event message recognition

commit f75159e9936143177b442afc78150b7a7ad8aa07 upstream.

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/ptp_classify.h