From: Tomek Mrugalski Date: Mon, 7 Dec 2015 17:00:55 +0000 (+0100) Subject: [4206_0.9.1] Fix for empty client-id in v4 X-Git-Tag: kea-0.9.1-P1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2a5f545cd3ab83679a10ed2e085445a54ca7b5e;p=thirdparty%2Fkea.git [4206_0.9.1] Fix for empty client-id in v4 --- diff --git a/src/bin/dhcp4/dhcp4_messages.mes b/src/bin/dhcp4/dhcp4_messages.mes index 7707044e94..224605f41f 100644 --- a/src/bin/dhcp4/dhcp4_messages.mes +++ b/src/bin/dhcp4/dhcp4_messages.mes @@ -247,6 +247,11 @@ the message has been received. The DHCPv4 server has received a packet that it is unable to interpret. The reason why the packet is invalid is included in the message. +% DHCP4_PACKET_PROCESS_EXCEPTION exception occurred during packet processing: %1 +This error message indicates that an exception was raised during packet processing +that was not caught by other, more specific exception handlers. This packet will +be dropped and the server will continue operation. + % DHCP4_PACKET_PROCESS_FAIL failed to process packet received from %1: %2 This is a general catch-all message indicating that the processing of a received packet failed. The reason is given in the message. The server diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index 914e46ed13..642567d28b 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -306,6 +306,8 @@ Dhcpv4Srv::run() { Pkt4Ptr query; Pkt4Ptr rsp; + try { + try { // The lease database backend may install some timers for which // the handlers need to be executed periodically. Retrieve the @@ -588,6 +590,19 @@ Dhcpv4Srv::run() { LOG_ERROR(dhcp4_logger, DHCP4_PACKET_SEND_FAIL) .arg(e.what()); } + + } catch (const std::exception& e) { + // General catch-all exception that are not caught by more specific + // catches. This one is for exceptions derived from std::exception. + LOG_ERROR(dhcp4_logger, DHCP4_PACKET_PROCESS_EXCEPTION) + .arg(e.what()); + } catch (...) { + // General catch-all exception that are not caught by more specific + // catches. This one is for other exceptions, not derived from + // std::exception. + LOG_ERROR(dhcp4_logger, DHCP4_PACKET_PROCESS_EXCEPTION) + .arg("an unknown exception not derived from std::exception"); + } } return (true);