]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3504b] processRelease() drops packets from bad location (i.e., no subnet)
authorFrancis Dupont <fdupont@isc.org>
Wed, 3 Jun 2015 13:18:55 +0000 (15:18 +0200)
committerFrancis Dupont <fdupont@isc.org>
Wed, 3 Jun 2015 13:18:55 +0000 (15:18 +0200)
src/bin/dhcp4/dhcp4_srv.cc

index b9924e9f264448512fac7754f012ebde156a8fe6..4d2c81169ff1680c05430a566fdd9a23b4cac0ff 100644 (file)
@@ -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());