aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pim.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2011-02-23 17:00:20 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2011-02-23 17:00:20 +0000
commit02d491eed93d9f3b54eeb9a6bec8cbf13a98f1ab (patch)
tree87621f551bfa7c66ecadb075d6f8a59cbc23d734 /epan/dissectors/packet-pim.c
parented66081a4d6438242740dacd18bda46c717f0d42 (diff)
From Alexis La Goutte via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5713 :
Enhance PIM * Replace struct ip6_hdr/tvb_m by tvb_ip6_to_str * Remove dependency to packet-ipv6.h svn path=/trunk/; revision=36032
Diffstat (limited to 'epan/dissectors/packet-pim.c')
-rw-r--r--epan/dissectors/packet-pim.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/epan/dissectors/packet-pim.c b/epan/dissectors/packet-pim.c
index 47d08c6f78..e3b5d3eaed 100644
--- a/epan/dissectors/packet-pim.c
+++ b/epan/dissectors/packet-pim.c
@@ -27,13 +27,11 @@
# include "config.h"
#endif
-#include <stddef.h> /* For offsetof */
#include <glib.h>
#include <epan/packet.h>
#include <epan/ipproto.h>
#include <epan/afn.h>
-#include "packet-ipv6.h"
#include <epan/in_cksum.h>
#include "packet-pim.h"
@@ -287,19 +285,16 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
"Group: %s",
tvb_ip_to_str(tvb, offset + 16));
} else if (pinfo->src.type == AT_IPv6) {
- struct ip6_hdr ip6_hdr;
- tvb_memcpy(tvb, (guint8 *)&ip6_hdr, offset,
- sizeof ip6_hdr);
proto_tree_add_text(pimopt_tree, tvb, offset, -1,
"IPv6 dummy header");
proto_tree_add_text(pimopt_tree, tvb,
- offset + offsetof(struct ip6_hdr, ip6_src), 16,
+ offset + 8, 16,
"Source: %s",
- ip6_to_str(&ip6_hdr.ip6_src));
+ tvb_ip6_to_str(tvb, offset + 8));
proto_tree_add_text(pimopt_tree, tvb,
- offset + offsetof(struct ip6_hdr, ip6_dst), 16,
+ offset + 8 + 16, 16,
"Group: %s",
- ip6_to_str(&ip6_hdr.ip6_dst));
+ tvb_ip6_to_str(tvb, offset + 8));
} else
proto_tree_add_text(pimopt_tree, tvb, offset, -1,
"Dummy header for an unknown protocol");
@@ -901,19 +896,16 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
"Group: %s",
tvb_ip_to_str(tvb, offset + 16));
} else if (pinfo->src.type == AT_IPv6) {
- struct ip6_hdr ip6_hdr;
- tvb_memcpy(tvb, (guint8 *)&ip6_hdr, offset,
- sizeof ip6_hdr);
proto_tree_add_text(pimopt_tree, tvb, offset, -1,
"IPv6 dummy header");
proto_tree_add_text(pimopt_tree, tvb,
- offset + offsetof(struct ip6_hdr, ip6_src), 16,
+ offset + 8, 16,
"Source: %s",
- ip6_to_str(&ip6_hdr.ip6_src));
+ tvb_ip6_to_str(tvb, offset + 8));
proto_tree_add_text(pimopt_tree, tvb,
- offset + offsetof(struct ip6_hdr, ip6_dst), 16,
+ offset + 8 + 16, 16,
"Group: %s",
- ip6_to_str(&ip6_hdr.ip6_dst));
+ tvb_ip6_to_str(tvb, offset + 8 + 16));
} else
proto_tree_add_text(pimopt_tree, tvb, offset, -1,
"Dummy header for an unknown protocol");