aboutsummaryrefslogtreecommitdiff
path: root/print-lisp.c
diff options
context:
space:
mode:
Diffstat (limited to 'print-lisp.c')
-rw-r--r--print-lisp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/print-lisp.c b/print-lisp.c
index 0012e06e..756fff0f 100644
--- a/print-lisp.c
+++ b/print-lisp.c
@@ -283,8 +283,8 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length)
goto invalid;
/* Print all the EID records */
- while ((length > packet_offset) && (record_count--)) {
-
+ while ((length > packet_offset) && (record_count != 0)) {
+ record_count--;
ND_TCHECK_LEN(packet_iterator + packet_offset,
MAP_REGISTER_EID_LEN);
ND_PRINT("\n");
@@ -326,7 +326,8 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length)
ND_PRINT(" %u locator(s)", loc_count);
- while (loc_count--) {
+ while (loc_count != 0) {
+ loc_count--;
ND_TCHECK_LEN(packet_iterator + packet_offset,
MAP_REGISTER_LOC_LEN);
lisp_loc = (const lisp_map_register_loc *) (packet_iterator + packet_offset);