From: morriss Date: Wed, 23 Feb 2011 17:00:20 +0000 (+0000) Subject: From Alexis La Goutte via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5713 : X-Git-Url: http://git.samba.org/samba.git/?p=obnox%2Fwireshark%2Fwip.git;a=commitdiff_plain;h=06469e16368ca5482b77afb27d34c1cbcce211f4 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 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36032 f5534014-38df-0310-8fa8-9805f1628bb7 --- 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");