Sorry for the churn, but now I understand how the minor version is
not part of the PORT_DATA_SET or of the VERSION_NUMBER TLV.  Even
though this might have been an oversight, still, as written, the
standard is crystal clear on this point.

On Mon, Mar 01, 2021 at 11:40:30AM +0800, Yangbo Lu wrote:

> diff --git a/pmc.c b/pmc.c
> index 3678800..ea2af3f 100644
> --- a/pmc.c
> +++ b/pmc.c
> @@ -413,12 +413,14 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
>                       IFMT "logSyncInterval         %hhd"
>                       IFMT "delayMechanism          %hhu"
>                       IFMT "logMinPdelayReqInterval %hhd"
> -                     IFMT "versionNumber           %hhu",
> +                     IFMT "versionNumber           %u.%u",

Please drop the .%u here, and ...

>                       pid2str(&p->portIdentity), ps_str[p->portState],
>                       p->logMinDelayReqInterval, p->peerMeanPathDelay >> 16,
>                       p->logAnnounceInterval, p->announceReceiptTimeout,
>                       p->logSyncInterval, p->delayMechanism,
> -                     p->logMinPdelayReqInterval, p->versionNumber);
> +                     p->logMinPdelayReqInterval,
> +                     p->versionNumber & MAJOR_VERSION_MASK,

keep this part, just in case some other stacks do include the minor
version in the reserved nibble.

> +                     p->versionNumber >> 4);

And drop this.

Please also update the code that sends PORT_DATA_SET and
VERSION_NUMBER so that it applies the mask:

        p->versionNumber & MAJOR_VERSION_MASK

Thanks,
Richard


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

Reply via email to