In addition to the existing blacklist preventing some management
requests from being forwarded to the UDS, we should also not
forward those responses we've simply overheard on the network if
weren't addressed to the local clockIdentiry.

This way users of the UDS will still get responses to any requests
they've hopped onto the wider network, but won't have do deal with
unrelated chatter between other machines.
---
 clock.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/clock.c b/clock.c
index 146576a..63c4ef7 100644
--- a/clock.c
+++ b/clock.c
@@ -1280,13 +1280,20 @@ 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. */
+       /* Don't forward any requests or responses we didn't
+       * orignate to the UDS port. */
        if (out == c->uds_port) {
                switch (management_action(msg)) {
                case GET:
                case SET:
                case COMMAND:
                        return 0;
+               case RESPONSE:
+               case ACKNOWLEDGE:
+                       if 
(!cid_eq(&msg->management.targetPortIdentity.clockIdentity,
+                                               &c->dds.clockIdentity)) {
+                               return 0;
+                       }
                }
        }
 
-- 
2.20.1 (Apple Git-117)



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to