Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PTP: Refine timestamp printing. #1277

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

infrastation
Copy link
Member

Fixes #1260.

Move nanosecond-specific constants from print-arista.c to netdissect.h.
In ptp_print_timestamp_identity() and ptp_print_announce_msg() use
ptp_print_timestamp() to deduplicate code.  In ptp_print_timestamp()
change the format to SECONDS.NANOSECONDS and a bogus nanoseconds value
indicator.  Update the tests.  This resolves GH issue the-tcpdump-group#1260.
@@ -518,6 +518,9 @@ extern int unaligned_memcmp(const void *, const void *, size_t);
#define PLURAL_SUFFIX(n) \
(((n) != 1) ? "s" : "")

#define MAX_VALID_NS 999999999U
#define BOGUS_NS_STR "(bogus ns!)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to use " (invalid ns)" like in util-print.c, ts_frac_print() and remove the space in the ND_PRINT().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Point taken.

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

Successfully merging this pull request may close these issues.

ptp: originTimeStamp field comma inconsistent between announce, sync
2 participants