]> git.proxmox.com Git - pve-lxc-syscalld.git/blobdiff - src/process/id_map.rs
fix id mapping code
[pve-lxc-syscalld.git] / src / process / id_map.rs
index d61d489da7af7418908fd8d85f1660c435b7c73e..2f71953075eedca54254ed8d6c27db71f6a20120 100644 (file)
@@ -26,7 +26,7 @@ impl IdMap {
     pub fn map_from(&self, id: u64) -> Option<u64> {
         for entry in self.0.iter() {
             if entry.ns <= id && entry.ns + entry.range > id {
-                return Some(id + entry.host);
+                return Some(entry.host + id - entry.ns);
             }
         }