From: Tomek Mrugalski Date: Tue, 8 Mar 2016 13:27:31 +0000 (+0100) Subject: [4226] Reverted previous changes to Pkt4::getName() X-Git-Tag: trac4248_base~15^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c8e0552a02c3f7020420f39e160881f737353efa;p=thirdparty%2Fkea.git [4226] Reverted previous changes to Pkt4::getName() --- diff --git a/src/lib/dhcp/pkt4.cc b/src/lib/dhcp/pkt4.cc index 6cb2ec1667..706574b5b0 100644 --- a/src/lib/dhcp/pkt4.cc +++ b/src/lib/dhcp/pkt4.cc @@ -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