Discussion:
[Linuxptp-devel] [PATCH][RFC] fix the check for supported timestamping modes
Jiri Bohac
2013-05-15 15:29:12 UTC
Permalink
Fix the check for supported timestamping modes. The device needs
to support all the required modes, not just any subset of them.

Signed-off-by: Jiri Bohac <***@suse.cz>

diff --git a/ptp4l.c b/ptp4l.c
index 3792375..ecaf9ed 100644
--- a/ptp4l.c
+++ b/ptp4l.c
@@ -325,7 +325,7 @@ int main(int argc, char *argv[])
/* check whether timestamping mode is supported. */
for (i = 0; i < cfg_settings.nports; i++) {
if (iface[i].ts_info.valid &&
- !(iface[0].ts_info.so_timestamping & required_modes)) {
+ ((iface[0].ts_info.so_timestamping & required_modes) != required_modes)) {
fprintf(stderr, "interface '%s' does not support "
"requested timestamping mode.\n",
iface[i].name);
--
Jiri Bohac <***@suse.cz>
SUSE Labs, SUSE CZ
Keller, Jacob E
2013-05-15 20:36:04 UTC
Permalink
-----Original Message-----
Sent: Wednesday, May 15, 2013 8:29 AM
Subject: [Linuxptp-devel] [PATCH][RFC] fix the check for supported
timestamping modes
Fix the check for supported timestamping modes. The device needs
to support all the required modes, not just any subset of them.
diff --git a/ptp4l.c b/ptp4l.c
index 3792375..ecaf9ed 100644
--- a/ptp4l.c
+++ b/ptp4l.c
@@ -325,7 +325,7 @@ int main(int argc, char *argv[])
/* check whether timestamping mode is supported. */
for (i = 0; i < cfg_settings.nports; i++) {
if (iface[i].ts_info.valid &&
- !(iface[0].ts_info.so_timestamping &
required_modes)) {
+ ((iface[0].ts_info.so_timestamping &
required_modes) != required_modes)) {
fprintf(stderr, "interface '%s' does not support "
"requested timestamping mode.\n",
iface[i].name);
--
SUSE Labs, SUSE CZ
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers
complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Linuxptp-devel mailing list
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
ACK. Looks good.

- Jake
Richard Cochran
2013-05-16 12:39:42 UTC
Permalink
Post by Jiri Bohac
Fix the check for supported timestamping modes. The device needs
to support all the required modes, not just any subset of them.
Applied.

Thanks,
Richard

Loading...