aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ip.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-08-29 22:15:19 +0000
committerGuy Harris <guy@alum.mit.edu>2003-08-29 22:15:19 +0000
commitc8ea4075266853bf4b3b3eba5515e5e40cb61961 (patch)
treee3b2bdc791948138ab9e1fcb92d154bcb157ba82 /packet-ip.c
parentebd1b7a744ca740126718be3d2cf3b4dfb231cbb (diff)
Set "addr" before using it, regardless of whether "ip_summary_in_tree"
is set or not. Copy the destination address, not the source address, when processing the destination address. svn path=/trunk/; revision=8314
Diffstat (limited to 'packet-ip.c')
-rw-r--r--packet-ip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/packet-ip.c b/packet-ip.c
index e682940193..939cf166bb 100644
--- a/packet-ip.c
+++ b/packet-ip.c
@@ -1,7 +1,7 @@
/* packet-ip.c
* Routines for IP and miscellaneous IP protocol packet disassembly
*
- * $Id: packet-ip.c,v 1.198 2003/08/29 01:57:37 gerald Exp $
+ * $Id: packet-ip.c,v 1.199 2003/08/29 22:15:19 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -970,8 +970,8 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
SET_ADDRESS(&pinfo->src, AT_IPv4, 4, tvb_get_ptr(tvb, offset + IPH_SRC, 4));
SET_ADDRESS(&iph->ip_src, AT_IPv4, 4, tvb_get_ptr(tvb, offset + IPH_SRC, 4));
if (tree) {
+ memcpy(&addr, iph->ip_src.data, 4);
if (ip_summary_in_tree) {
- memcpy(&addr, iph->ip_src.data, 4);
proto_item_append_text(ti, ", Src Addr: %s (%s)",
get_hostname(addr), ip_to_str((guint8 *) iph->ip_src.data));
}
@@ -984,8 +984,8 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
SET_ADDRESS(&iph->ip_dst, AT_IPv4, 4, tvb_get_ptr(tvb, offset + IPH_DST, 4));
if (tree) {
+ memcpy(&addr, iph->ip_dst.data, 4);
if (ip_summary_in_tree) {
- memcpy(&addr, iph->ip_src.data, 4);
proto_item_append_text(ti, ", Dst Addr: %s (%s)",
get_hostname(addr), ip_to_str((guint8 *) iph->ip_dst.data));
}