The UDS port is not expected to be used by PTP clocks and forwarding of
management messages to the port can be limited to responses.

This prevents ptp4l from printing error messages when a management
request is received from a non-UDS port and the last client which used
the UDS port is no longer listening.

Signed-off-by: Miroslav Lichvar <mlich...@redhat.com>
---
 clock.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/clock.c b/clock.c
index 41c8f81..6dbc45e 100644
--- a/clock.c
+++ b/clock.c
@@ -1243,6 +1243,17 @@ static int clock_do_forward_mgmt(struct clock *c,
 {
        if (in == out || !forwarding(c, out))
                return 0;
+
+       /* Don't forward any requests to the UDS port. */
+       if (out == c->uds_port) {
+               switch (management_action(msg)) {
+               case GET:
+               case SET:
+               case COMMAND:
+                       return 0;
+               }
+       }
+
        if (!*pre_sent) {
                /* delay calling msg_pre_send until
                 * actually forwarding */
-- 
2.9.5


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to