From: g0dil Date: Thu, 5 Mar 2009 15:05:46 +0000 (+0000) Subject: Packets/DefaultBundle: ICMPv6Packet skips checksum calculation when IPv6 header is... X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=bae85d8377946bd545cfa83cf703d62b2028e476;p=senf.git Packets/DefaultBundle: ICMPv6Packet skips checksum calculation when IPv6 header is missing git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1145 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Packets/DefaultBundle/ICMPv6Packet.cc b/Packets/DefaultBundle/ICMPv6Packet.cc index dc8eea1..0556fec 100644 --- a/Packets/DefaultBundle/ICMPv6Packet.cc +++ b/Packets/DefaultBundle/ICMPv6Packet.cc @@ -34,10 +34,15 @@ namespace { registerICMPv6Packet (58); } -prefix_ boost::uint16_t senf::ICMPv6PacketParser::calcChecksum() const { +prefix_ boost::uint16_t senf::ICMPv6PacketParser::calcChecksum() + const +{ senf::IpChecksum summer; senf::IPv6Packet ipv6 (packet().rfind(senf::nothrow)); + + if (! ipv6) + return 0u; summer.feed( ipv6->source().i(), ipv6->source().i() + senf::IPv6Packet::Parser::source_t::fixed_bytes );