summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2023-02-16 09:28:28 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2023-02-16 09:31:47 +0100
commitefc775d05163ac3591b30341ca944007fdc5753a (patch)
treec45a8f90db855a83a29d76fb469729b60b8b88c1
parent31762a4eb365011bb1862be817040d3f9ca72e64 (diff)
downloadtcpdump-efc775d05163ac3591b30341ca944007fdc5753a.tar.gz
RIPng: Print the protocol name when the version is invalid
Update the output of a test accordingly.
-rw-r--r--print-ripng.c3
-rw-r--r--tests/hoobr_ripng_print.out2
2 files changed, 3 insertions, 2 deletions
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)