diff --git a/ebpfcat/hashmap.py b/ebpfcat/hashmap.py index 1a74f7df27f7881ccc05887ae550659038f95bee..63c9d545291735b02af8c620785b9ac76f123cfa 100644 --- a/ebpfcat/hashmap.py +++ b/ebpfcat/hashmap.py @@ -31,8 +31,6 @@ class HashGlobalVar(Expression): @contextmanager def get_address(self, dst, long, signed, force=False): - if long is not None and long != (self.fmt in "qQ"): - raise AssembleError("HashMap variable has wrong size") if signed != self.fmt.islower(): raise AssembleError("HashMap variable has wrong signedness") with self.ebpf.save_registers([i for i in range(6) if i != dst]), \ @@ -80,8 +78,7 @@ class HashGlobalVarDesc: pack("q" if self.fmt.islower() else "Q", value), 0) return with ebpf.save_registers([3]): - with value.get_address(3, self.fmt in "qQ", - self.fmt.islower(), True): + with value.get_address(3, True, self.fmt.islower(), True): with ebpf.save_registers([0, 1, 2, 4, 5]), \ ebpf.get_stack(4) as stack: ebpf.r1 = ebpf.get_fd(ebpf.__dict__[self.name].fd)