aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-skinny.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-09-11 21:25:37 +0000
committerGuy Harris <guy@alum.mit.edu>2005-09-11 21:25:37 +0000
commit25c4bc9379996f934e7648f2ab8b8db3857439f6 (patch)
tree802a39b3b32b8079ff58c90a7a4e4be6385eb515 /epan/dissectors/packet-skinny.c
parent0bb7a6e0038f5e90851c6d866d3f4d2e75903ab2 (diff)
Replace tvb_memcpy() calls that extract IPv4 addresses into a guint32,
and that extract IPv6 addresses into a "struct e_in6_addr", with tvb_get_ipv4() and tvb_get_ipv6() calls - except for some that we remove, by using proto_tree_add_item(), rather than replacing. Have epan/tvbuff.h include epan/ipv6-utils.h, to define "struct e_in6_addr" (not necessary to declare the tvbuff routines, but including it there means "struct e_in6_addr" is guaranteed to be defined before those declarations, so we don't get compiler complaints if we define it *after* those declarations). svn path=/trunk/; revision=15758
Diffstat (limited to 'epan/dissectors/packet-skinny.c')
-rw-r--r--epan/dissectors/packet-skinny.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-skinny.c b/epan/dissectors/packet-skinny.c
index fca4ccbc07..ee7bb6c5ae 100644
--- a/epan/dissectors/packet-skinny.c
+++ b/epan/dissectors/packet-skinny.c
@@ -1393,7 +1393,7 @@ static void dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
src_addr.type=AT_IPv4;
src_addr.len=4;
src_addr.data=(guint8 *)&ipv4_address;
- tvb_memcpy(tvb, (guint8 *)&ipv4_address, offset+16, 4);
+ ipv4_address = tvb_get_ipv4(tvb, offset+16);
rtp_add_address(pinfo, &src_addr, tvb_get_letohl(tvb, offset+20), 0, "Skinny", pinfo->fd->num, NULL);
}
break;
@@ -1774,7 +1774,7 @@ static void dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
src_addr.type=AT_IPv4;
src_addr.len=4;
src_addr.data=(char *)&ipv4_address;
- tvb_memcpy(tvb, (char *)&ipv4_address, offset+20, 4);
+ ipv4_address = tvb_get_ipv4(tvb, offset+20);
rtp_add_address(pinfo, &src_addr, tvb_get_letohl(tvb, offset+24), 0, "Skinny", pinfo->fd->num, NULL);
}
break;