From: Tomek Mrugalski Date: Tue, 8 Dec 2015 17:21:20 +0000 (+0100) Subject: [4206_0.9.1] Safety checks added for DHCPv6 X-Git-Tag: kea-0.9.1-P1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a596895cc3e1aee890a604d9933361e8b6c84b6;p=thirdparty%2Fkea.git [4206_0.9.1] Safety checks added for DHCPv6 --- diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes index bd52a0405a..6ee16263a5 100644 --- a/src/bin/dhcp6/dhcp6_messages.mes +++ b/src/bin/dhcp6/dhcp6_messages.mes @@ -224,6 +224,11 @@ client requested renewal of multiples leases (by sending multiple IA options), the server will skip the renewal of the one in question and will proceed with other renewals as usual. +% DHCP6_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. + % DHCP6_HOOK_PACKET_RCVD_SKIP received DHCPv6 packet was dropped because a callout set the skip flag This debug message is printed when a callout installed on the pkt6_receive hook point set the skip flag. For this particular hook point, the diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 0fdd23f207..d705986cff 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -255,6 +255,8 @@ bool Dhcpv6Srv::run() { Pkt6Ptr query; Pkt6Ptr rsp; + try{ + try { // The lease database backend may install some timers for which // the handlers need to be executed periodically. Retrieve the @@ -582,6 +584,18 @@ bool Dhcpv6Srv::run() { .arg(e.what()); } } + + } catch (const std::exception& e) { + // General catch-all exception that are not caught by more specific + // catches. + LOG_ERROR(dhcp6_logger, DHCP6_PACKET_PROCESS_EXCEPTION) + .arg(e.what()); + } catch (...) { + // General catch-all non-standard exception that are not caught + // by more specific catches. + LOG_ERROR(dhcp6_logger, DHCP6_PACKET_PROCESS_EXCEPTION) + .arg("an unknown exception not derived from std::exception"); + } } return (true);