From: Francois-Xavier Le Bail Date: Thu, 16 Feb 2023 08:28:28 +0000 (+0100) Subject: RIPng: Print the protocol name when the version is invalid X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/efc775d05163ac3591b30341ca944007fdc5753a RIPng: Print the protocol name when the version is invalid Update the output of a test accordingly. --- diff --git a/print-ripng.c b/print-ripng.c index 224c17fe..94ebf1bc 100644 --- a/print-ripng.c +++ b/print-ripng.c @@ -117,7 +117,8 @@ ripng_print(netdissect_options *ndo, const u_char *dat, unsigned int length) ndo->ndo_protocol = "ripng"; vers = GET_U_1(rp->rip6_vers); if (vers != RIP6_VERSION) { - ND_PRINT(" [vers %u]", vers); + nd_print_protocol(ndo); + ND_PRINT(" [version %u, must be %u]", vers, RIP6_VERSION); goto invalid; } cmd = GET_U_1(rp->rip6_cmd); diff --git a/tests/hoobr_ripng_print.out b/tests/hoobr_ripng_print.out index 309cf8c9..b58cf8b2 100644 --- a/tests/hoobr_ripng_print.out +++ b/tests/hoobr_ripng_print.out @@ -1 +1 @@ - 1 05:27:12.808464432 IP 48.48.48.48.521 > 48.48.48.48.12336: [vers 48] (invalid) + 1 05:27:12.808464432 IP 48.48.48.48.521 > 48.48.48.48.12336: ripng [version 48, must be 1] (invalid)