Fix a subtle bug that when squashing sites that only have one decendent, speeds were being applied incorrectly.

This commit is contained in:
Herbert Wolverson 2024-06-14 16:23:12 -05:00
parent 779ef162d3
commit 20a7e3512d
2 changed files with 3 additions and 2 deletions

View File

@ -60,6 +60,7 @@ impl IpRanges {
/// Checks if an IP address is permitted.
pub fn is_permitted(&self, ip: IpAddr) -> bool {
//println!("Checking: {:?}", ip);
if let Some(_allow) = self.allowed.longest_match(ip) {
if let Some(_deny) = self.ignored.longest_match(ip) {
return false;

View File

@ -34,8 +34,8 @@ pub fn squash_single_aps(sites: &mut [UispSite]) -> Result<(), UispIntegrationEr
if s.parent_indices.contains(&squash_idx) {
s.parent_indices.remove(&squash_idx);
s.parent_indices.insert(new_parent);
s.max_up_mbps = up;
s.max_down_mbps = down;
s.max_up_mbps = u32::min(up, s.max_up_mbps);
s.max_down_mbps = u32::min(down, s.max_down_mbps);
}
});
sites[squash_idx].parent_indices.clear();