From 973920e91da3dd479611c3a2e2d0b344bfae5a32 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 13 Sep 2005 00:50:43 +0000 Subject: Convert some more "tvb_memcpy()"s fetching IPv4 and IPv6 addresses to calls to "tvb_get_ipv4()" and "tvb_get_ipv6()". Fix a call in the BGP dissector to properly fetch an IEEE floating-point number. Update some I-D info. svn path=/trunk/; revision=15774 --- epan/dissectors/packet-bootp.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'epan/dissectors/packet-bootp.c') diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c index a839da93e9..c2ed87f28e 100644 --- a/epan/dissectors/packet-bootp.c +++ b/epan/dissectors/packet-bootp.c @@ -2488,7 +2488,8 @@ dissect_packetcable_ietf_ccc(proto_tree *v_tree, tvbuff_t *tvb, int optoff, int optend, int revision) { int suboptoff = optoff; - guint8 subopt, subopt_len, ipv4_addr[4]; + guint8 subopt, subopt_len; + guint32 ipv4_addr; guint8 prov_type, fetch_tgt, timer_val; guint16 sec_tcm; proto_tree *pkt_s_tree; @@ -2520,9 +2521,9 @@ dissect_packetcable_ietf_ccc(proto_tree *v_tree, tvbuff_t *tvb, int optoff, "no room left in option for suboption value"); return (optend); } - tvb_memcpy(tvb, ipv4_addr, suboptoff, 4); - proto_item_append_text(vti, "%u.%u.%u.%u (%u byte%s%s)", - ipv4_addr[0], ipv4_addr[1], ipv4_addr[2], ipv4_addr[3], + ipv4_addr = tvb_get_ipv4(tvb, suboptoff); + proto_item_append_text(vti, "%s (%u byte%s%s)", + ip_to_str((guint8 *)&ipv4_addr), subopt_len, plurality(subopt_len, "", "s"), subopt_len != 4 ? " [Invalid]" : ""); @@ -2551,9 +2552,9 @@ dissect_packetcable_ietf_ccc(proto_tree *v_tree, tvbuff_t *tvb, int optoff, "no room left in option for suboption value"); return (optend); } - tvb_memcpy(tvb, ipv4_addr, suboptoff, 4); - proto_item_append_text(vti, "%u.%u.%u.%u (%u byte%s%s)", - ipv4_addr[0], ipv4_addr[1], ipv4_addr[2], ipv4_addr[3], + ipv4_addr = tvb_get_ipv4(tvb, suboptoff); + proto_item_append_text(vti, "%s (%u byte%s%s)", + ip_to_str((guint8 *)&ipv4_addr), subopt_len, plurality(subopt_len, "", "s"), subopt_len != 5 ? " [Invalid]" : ""); -- cgit v1.2.3