From aac97da8115bcf3e080a10be5a80451ed0daad19 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 14 Sep 2001 06:34:36 +0000 Subject: Squelch a signed vs. unsigned comparison complaint. Display the command in decimal, not hex, as that's how it's specified in the RFCs for RIP. svn path=/trunk/; revision=3932 --- packet-rip.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'packet-rip.c') diff --git a/packet-rip.c b/packet-rip.c index 0a72e0ee38..944634e677 100644 --- a/packet-rip.c +++ b/packet-rip.c @@ -2,13 +2,12 @@ * Routines for RIPv1 and RIPv2 packet disassembly * (c) Copyright Hannes R. Boehm * - * $Id: packet-rip.c,v 1.25 2001/09/13 08:08:53 guy Exp $ + * $Id: packet-rip.c,v 1.26 2001/09/14 06:34:36 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs + * By Gerald Combs * Copyright 1998 Gerald Combs * - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -96,7 +95,6 @@ dissect_rip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint8 command; guint8 version; guint16 family; - guint reported_length; if (check_col(pinfo->fd, COL_PROTOCOL)) col_set_str(pinfo->fd, COL_PROTOCOL, "RIP"); @@ -127,8 +125,7 @@ dissect_rip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset = RIP_HEADER_LENGTH; /* zero or more entries */ - reported_length = tvb_reported_length(tvb); - while (offset < reported_length) { + while (tvb_reported_length_remaining(tvb, offset) > 0) { family = tvb_get_ntohs(tvb, offset); switch (family) { case 2: /* IP */ @@ -208,7 +205,7 @@ proto_register_rip(void) { static hf_register_info hf[] = { { &hf_rip_command, - { "Command", "rip.command", FT_UINT8, BASE_HEX, + { "Command", "rip.command", FT_UINT8, BASE_DEC, VALS(command_vals), 0, "What type of RIP Command is this", HFILL }}, { &hf_rip_version, -- cgit v1.2.3