Skip to content

Commit 07c3f29

Browse files
committed
PTP: Print the protocol name before any check
Moreover: Print (unsupported) if the version is != 1 and != 2.
1 parent 4bea9a6 commit 07c3f29

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

print-ptp.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,13 +460,14 @@ ptp_print(netdissect_options *ndo, const u_char *bp, u_int length)
460460
* version 2.1.
461461
*/
462462
ndo->ndo_protocol = "ptp";
463+
nd_print_protocol_caps(ndo);
463464
ND_ICHECK_U(length, <, PTP_HDR_LEN);
464465
major_vers = GET_BE_U_2(bp) & PTP_MAJOR_VERS_MASK;
465466
minor_vers = (GET_BE_U_2(bp) & PTP_MINOR_VERS_MASK) >> 4;
466467
if (minor_vers)
467-
ND_PRINT("PTPv%u.%u", major_vers, minor_vers);
468+
ND_PRINT("v%u.%u", major_vers, minor_vers);
468469
else
469-
ND_PRINT("PTPv%u", major_vers);
470+
ND_PRINT("v%u", major_vers);
470471

471472
switch(major_vers) {
472473
case PTP_VER_1:
@@ -476,7 +477,7 @@ ptp_print(netdissect_options *ndo, const u_char *bp, u_int length)
476477
ptp_print_2(ndo, bp, length);
477478
break;
478479
default:
479-
//ND_PRINT("ERROR: unknown-version\n");
480+
ND_PRINT(" (unsupported)");
480481
break;
481482
}
482483
return;

0 commit comments

Comments
 (0)