Skip to content

Conversation

@garethsb
Copy link
Contributor

I hope this fixes a few issues:

  • The ptpPattern previously allowed lowercase hex digits, but the ABNF in RFC 7273 uses RFC 5234 HEXDIG, which only accepts uppercase.
  • The ptpPattern previously accepted the pre-RFC 7273 errata form for ptp-domain-name. (The resolution deletes the domain-name= prefix, similarly to the ptp-domain-nmbr case, which is already correct in this test.)
  • However, the ptp-domain-name form is in any case only used for IEEE 1588-2002 (v1), not 2008 (v2), so isn't necessary for ST 2110-10.
  • After the earlier update to the test to match the RFC 7273 traceable ABNF, the message about supported PTP versions needed updating.
  • In order to capture other unexpected extra trailing characters, I've added a $ to the end of the regex, which means the check for !ptpMatch[4] && ptpDetails.endsWith(':') is no longer required since that case will be caught by the earlier one (!ptpPattern.test(ptpDetails.slice(14)))
  • I don't believe the domainNmbr error could have fired before, since ptpMatch[4] includes the colon, so +ptpMatch[4] would always have been zero. I've changed this to ptpMatch[5].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant