From: Francis Dupont Date: Wed, 3 Jun 2015 13:18:55 +0000 (+0200) Subject: [3504b] processRelease() drops packets from bad location (i.e., no subnet) X-Git-Tag: trac3889_base~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=781d14b3cefe85bbb8aea066d29e74e95ef838aa;p=thirdparty%2Fkea.git [3504b] processRelease() drops packets from bad location (i.e., no subnet) --- diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index b9924e9f26..4d2c81169f 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -1685,6 +1685,15 @@ Dhcpv4Srv::processRelease(Pkt4Ptr& release) { client_id = ClientIdPtr(new ClientId(opt->getData())); } + Subnet4Ptr subnet = selectSubnet(release); + if (!subnet) { + // No subnet - release no sent from the proper location + LOG_DEBUG(lease_logger, DBG_DHCP4_DETAIL, DHCP4_RELEASE_FAIL_NO_SUBNET) + .arg(release->getLabel()) + .arg(release->getCiaddr().toText()); + return; + } + try { // Do we have a lease for that particular address? Lease4Ptr lease = LeaseMgrFactory::instance().getLease4(release->getCiaddr());