Some network interfaces do not specify PTP clock id that provides interface to
their hardware clock. In this case the interface driver returns -1 in
`ethtool_ts_info` to SIOCETHTOOL. This commit makes linuxptp ignore it instead
of failing with error "PHC device mismatch".

Signed-off-by: Ivan Oleynikov <i...@metrotek.spb.ru>
---
 port.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/port.c b/port.c
index 161157c..29b2468 100644
--- a/port.c
+++ b/port.c
@@ -2550,7 +2550,8 @@ struct port *port_open(int phc_index,
                ; /* UDS cannot have a PHC. */
        else if (!interface->ts_info.valid)
                pr_warning("port %d: get_ts_info not supported", number);
-       else if (phc_index >= 0 && phc_index != interface->ts_info.phc_index) {
+       else if (phc_index >= 0 && phc_index != interface->ts_info.phc_index &&
+               interface->ts_info.phc_index >= 0) {
                if (p->jbod) {
                        pr_warning("port %d: just a bunch of devices", number);
                        p->phc_index = interface->ts_info.phc_index;
-- 
2.1.4


-- 
Ivan Oleynikov
STC Metrotek
St.Petersburg

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to