aboutsummaryrefslogtreecommitdiff
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-04-02 16:04:36 +0200
commitf09ba3ed6ea97ce5a33728f78e64c64cfa9c7810 (patch)
tree1c4e9ed80e10e060a9ca4c291366a716a1236a2a
parente959e547996fc1cf951be52e1c0735ec6cf3a195 (diff)
downloadtcpdump-f09ba3ed6ea97ce5a33728f78e64c64cfa9c7810.tar.gz
RIPng: Print the protocol name when the version is invalid
Update the output of a test accordingly. (cherry picked from commit efc775d05163ac3591b30341ca944007fdc5753a)
-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)