aboutsummaryrefslogtreecommitdiffstats
path: root/packet-icmpv6.c
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@itojun.org>2000-08-18 15:52:02 +0000
committerJun-ichiro itojun Hagino <itojun@itojun.org>2000-08-18 15:52:02 +0000
commite2eb846d0fdc9e2646190a86f04aa67f7d3942b1 (patch)
treecdc73e8960629155bdcc392e0cc73cc995abdf3d /packet-icmpv6.c
parent9c05ee2741a013a4cdba91e03d6ee9b60defb93e (diff)
avoid pointer typecast, which leads to unaligned access.
svn path=/trunk/; revision=2294
Diffstat (limited to 'packet-icmpv6.c')
-rw-r--r--packet-icmpv6.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/packet-icmpv6.c b/packet-icmpv6.c
index 29b267ff4f..651793c87a 100644
--- a/packet-icmpv6.c
+++ b/packet-icmpv6.c
@@ -1,7 +1,7 @@
/* packet-icmpv6.c
* Routines for ICMPv6 packet disassembly
*
- * $Id: packet-icmpv6.c,v 1.21 2000/08/18 12:05:26 itojun Exp $
+ * $Id: packet-icmpv6.c,v 1.22 2000/08/18 15:52:02 itojun Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -214,8 +214,7 @@ again:
* Note that the packet format was changed several times in the past.
*/
static void
-dissect_nodeinfo(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
- proto_tree *parent)
+dissect_nodeinfo(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
proto_tree *field_tree;
proto_item *tf;
@@ -329,7 +328,7 @@ dissect_nodeinfo(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
case ICMP6_NI_SUBJ_FQDN:
tf = proto_tree_add_text(tree, NullTVB,
offset + sizeof(*ni), sizeof(gint32),
- "TTL: %d", *(gint32 *)(ni + 1));
+ "TTL: %d", (gint32)pntohl(ni + 1));
/* XXX TBD */
break;
case ICMP6_NI_SUBJ_IPV4:
@@ -388,7 +387,7 @@ dissect_nodeinfo(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
}
/* the rest of data */
- old_dissect_data(pd, offset + off, fd, parent);
+ old_dissect_data(pd, offset + off, fd, tree);
}
static void
@@ -815,7 +814,7 @@ dissect_icmpv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
"Query type: 0x%04x (%s)", pntohs(&ni->ni_qtype),
val_to_str(pntohs(&ni->ni_qtype), names_nodeinfo_qtype,
"Unknown"));
- dissect_nodeinfo(pd, offset, fd, icmp6_tree, tree);
+ dissect_nodeinfo(pd, offset, fd, icmp6_tree);
break;
default:
old_dissect_data(pd, offset + sizeof(*dp), fd, tree);