From 02d491eed93d9f3b54eeb9a6bec8cbf13a98f1ab Mon Sep 17 00:00:00 2001 From: Jeff Morriss Date: Wed, 23 Feb 2011 17:00:20 +0000 Subject: [PATCH] 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 --- epan/dissectors/packet-pim.c | 24 ++++++++---------------- 1 file 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 /* For offsetof */ #include #include #include #include -#include "packet-ipv6.h" #include #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");