From 5109a65f791280b3549377851e4bdd77f802c207 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 22 Aug 2023 12:23:20 -0700 Subject: [PATCH] pgm: don't advance bp by the option haeder length twice. At those points, we've already advanced it by the option header length, and opt_len includes that length, so advance bp by opt_len minus the option header length. (cherry picked from commit 09b0447fad52298440e05e7368f9d24492d0b0fe) --- print-pgm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/print-pgm.c b/print-pgm.c index 8340f2c3..7672b616 100644 --- a/print-pgm.c +++ b/print-pgm.c @@ -668,7 +668,7 @@ pgm_print(netdissect_options *ndo, case PGM_OPT_PATH_NLA: ND_PRINT((ndo, " PATH_NLA [%d]", opt_len)); - bp += opt_len; + bp += opt_len - 2; opts_len -= opt_len; break; @@ -710,7 +710,7 @@ pgm_print(netdissect_options *ndo, case PGM_OPT_CR: ND_PRINT((ndo, " CR")); - bp += opt_len; + bp += opt_len - 2; opts_len -= opt_len; break; @@ -814,7 +814,7 @@ pgm_print(netdissect_options *ndo, default: ND_PRINT((ndo, " OPT_%02X [%d] ", opt_type, opt_len)); - bp += opt_len; + bp += opt_len - 2; opts_len -= opt_len; break; } -- 2.41.0