diff --git a/msg.h b/msg.h index c28dd0b..f479e9c 100644 --- a/msg.h +++ b/msg.h @@ -212,6 +212,17 @@ static inline Boolean field_is_set(struct ptp_message *m, int index, Octet bit) return m->header.flagField[index] & bit ? TRUE : FALSE; } +/** + * Obtain the transportSpecific field from a message. + * @param m Message to test. + * @return The value of the transportSpecific field. Note that the + * value is returned unshifted, in the upper nibble. + */ +static inline UInteger8 msg_transport_specific(struct ptp_message *m) +{ + return m->header.tsmt & 0xf0; +} + /** * Obtain the message type. * @param m Message to test. diff --git a/port.c b/port.c index e2fe9cc..910ecee 100644 --- a/port.c +++ b/port.c @@ -290,6 +290,9 @@ static int port_ignore(struct port *p, struct ptp_message *m) { struct ClockIdentity c1, c2; + if (msg_transport_specific(m) != p->transportSpecific) { + return 1; + } if (pid_eq(&m->header.sourcePortIdentity, &p->portIdentity)) { return 1; }