]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[4226] Reverted previous changes to Pkt4::getName()
authorTomek Mrugalski <tomasz@isc.org>
Tue, 8 Mar 2016 13:27:31 +0000 (14:27 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Tue, 8 Mar 2016 13:27:31 +0000 (14:27 +0100)
src/lib/dhcp/pkt4.cc

index 6cb2ec1667ccae973b0341c1a65d8f0e08252ab1..706574b5b0615bd8e7f12007bd4021992db85035 100644 (file)
@@ -328,15 +328,10 @@ Pkt4::getName(const uint8_t type) {
 
 const char*
 Pkt4::getName() const {
-
-    uint8_t msg_type = 0;
-    try {
-        msg_type = getType();
-    } catch (...) {
-        // Message Type option is missing.
-    }
-
-    return (Pkt4::getName(msg_type));
+    // getType() is now exception safe. Even if there's no option 53 (message
+    // type), it now returns 0 rather than throw. getName() is able to handle
+    // 0 and unknown message types.
+    return (Pkt4::getName(getType()));
 }
 
 std::string