- updated MPESection creation
[senf.git] / Packets / DefaultBundle / LlcSnapPacket.cc
index 77378cd..4442463 100644 (file)
@@ -1,9 +1,9 @@
-// $Id: EthernetPacket.cc 523 2007-11-16 10:34:57Z tho $
+// $Id$
 //
 // Copyright (C) 2007
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
-//     Stefan Bund <stefan.bund@fokus.fraunhofer.de>
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
+//     Thorsten Horstmann <tho@berlios.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -61,14 +61,11 @@ prefix_ senf::PacketInterpreterBase::factory_t senf::LlcSnapPacketType::nextPack
 
 prefix_ void senf::LlcSnapPacketType::finalize(packet p)
 {
-    optional_registry_key_t k = key(p.next());
+    optional_key_t k (key(p.next(nothrow)));
     if (k)
         p->type_length() << k;
-    else
-        if (p.next().is<EthernetPacket>())
-            p->type_length() << p.next().data().size();
-        else
-            p->type_length() << 0;
+    else if (p.next().is<EthernetPacket>())
+        p->type_length() << p.next().data().size();
 }