// belong to subnets outside of the shared network. We'll need
// to eliminate them.
for (auto host = hosts.begin(); host != hosts.end(); ++host) {
- if ((*host)->getIPv6SubnetID() > 0) {
+ if ((*host)->getIPv6SubnetID() != SUBNET_ID_GLOBAL) {
host_map[(*host)->getIPv6SubnetID()] = *host;
}
}
subnet->getReservationsInSubnet()) {
// Iterate over configured identifiers in the order of preference
// and try to use each of them to search for the reservations.
- for (const IdentifierPair& id_pair : ctx.host_identifiers_) {
- if (use_single_query) {
- if (host_map.count(subnet->getID()) > 0) {
- ctx.hosts_[subnet->getID()] = host_map[subnet->getID()];
- break;
- }
-
- } else {
+ if (use_single_query) {
+ if (host_map.count(subnet->getID()) > 0) {
+ ctx.hosts_[subnet->getID()] = host_map[subnet->getID()];
+ }
+ } else {
+ for (const IdentifierPair& id_pair : ctx.host_identifiers_) {
// Attempt to find a host using a specified identifier.
ConstHostPtr host = HostMgr::instance().get6(subnet->getID(),
id_pair.first,
// belong to subnets outside of the shared network. We'll need
// to eliminate them.
for (auto host = hosts.begin(); host != hosts.end(); ++host) {
- if ((*host)->getIPv4SubnetID() > 0) {
+ if ((*host)->getIPv4SubnetID() != SUBNET_ID_GLOBAL) {
host_map[(*host)->getIPv4SubnetID()] = *host;
}
}
subnet->getReservationsInSubnet()) {
// Iterate over configured identifiers in the order of preference
// and try to use each of them to search for the reservations.
- for (const IdentifierPair& id_pair : ctx.host_identifiers_) {
- if (use_single_query) {
- if (host_map.count(subnet->getID()) > 0) {
- ctx.hosts_[subnet->getID()] = host_map[subnet->getID()];
- break;
- }
-
- } else {
+ if (use_single_query) {
+ if (host_map.count(subnet->getID()) > 0) {
+ ctx.hosts_[subnet->getID()] = host_map[subnet->getID()];
+ }
+ } else {
+ for (const IdentifierPair& id_pair : ctx.host_identifiers_) {
// Attempt to find a host using a specified identifier.
ConstHostPtr host = HostMgr::instance().get4(subnet->getID(),
id_pair.first,