diff --git a/port.h b/port.h index e347e36..80c543e 100644 --- a/port.h +++ b/port.h @@ -33,6 +33,9 @@ struct clock; /** Opaque type. */ struct port; +/** The port identity that matches any port. */ +extern const struct PortIdentity wildcard_pid; + /** * Returns the dataset from a port's best foreign clock record, if any * has yet been discovered. This function does not bring the returned diff --git a/port_signaling.c b/port_signaling.c index c4d5469..cbd0cf4 100644 --- a/port_signaling.c +++ b/port_signaling.c @@ -23,7 +23,7 @@ #include "unicast_client.h" #include "unicast_service.h" -static struct PortIdentity wildcard = { +const struct PortIdentity wildcard_pid = { .clockIdentity = { {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff} }, @@ -126,7 +126,7 @@ int process_signaling(struct port *p, struct ptp_message *m) /* Ignore signaling messages not addressed to this port. */ if (!pid_eq(&m->signaling.targetPortIdentity, &p->portIdentity) && - !pid_eq(&m->signaling.targetPortIdentity, &wildcard)) { + !pid_eq(&m->signaling.targetPortIdentity, &wildcard_pid)) { return 0; }