Packets: BUGFIX: Remove DataPacket from Ip registry
g0dil [Thu, 17 Jan 2008 17:02:53 +0000 (17:02 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@620 270642c3-0616-0410-b53a-bc976706d245

Packets/DefaultBundle/IPv6Packet.cc

index 7f4029c..8240f5b 100644 (file)
@@ -42,9 +42,6 @@ namespace {
 
     senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IPv6Packet>
         registerIPv6Packet2 (41); // IP6-in-IP(6) encapsulation
-
-    senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::DataPacket>
-        registerNoNextHeader (59);
 }
 
 prefix_ void senf::IPv6PacketType::dump(packet p, std::ostream & os)
@@ -66,7 +63,12 @@ prefix_ void senf::IPv6PacketType::dump(packet p, std::ostream & os)
 prefix_ void senf::IPv6PacketType::finalize(packet p)
 {
     p->length() << (p.size() - IPv6PacketParser::fixed_bytes);
-    p->nextHeader() << key(p.next(nothrow));
+    try {
+        p->nextHeader() << key(p.next());
+    }
+    catch (InvalidPacketChainException & ex) {
+        p->nextHeader() << 59; // No next header
+    }
 }
 
 ///////////////////////////////cc.e////////////////////////////////////////