Browse Source

[3504b] processRelease() drops packets from bad location (i.e., no subnet)

Francis Dupont 10 years ago
parent
commit
781d14b3ce
1 changed files with 9 additions and 0 deletions
  1. 9 0
      src/bin/dhcp4/dhcp4_srv.cc

+ 9 - 0
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());