Drop incoming packets on transportSpecific mismatch.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
9bdf92a7cf
commit
6258aa0bad
11
msg.h
11
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;
|
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.
|
* Obtain the message type.
|
||||||
* @param m Message to test.
|
* @param m Message to test.
|
||||||
|
|
3
port.c
3
port.c
|
@ -290,6 +290,9 @@ static int port_ignore(struct port *p, struct ptp_message *m)
|
||||||
{
|
{
|
||||||
struct ClockIdentity c1, c2;
|
struct ClockIdentity c1, c2;
|
||||||
|
|
||||||
|
if (msg_transport_specific(m) != p->transportSpecific) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
if (pid_eq(&m->header.sourcePortIdentity, &p->portIdentity)) {
|
if (pid_eq(&m->header.sourcePortIdentity, &p->portIdentity)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue