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