From b16e8d2eb8f633ff3b5b536428cafb5a5e1bd9db Mon Sep 17 00:00:00 2001
From: Martin Teichmann <martin.teichmann@xfel.eu>
Date: Mon, 15 Feb 2021 07:21:02 +0000
Subject: [PATCH] make hashmap work again, at least somehow

---
 ebpfcat/hashmap.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/ebpfcat/hashmap.py b/ebpfcat/hashmap.py
index 1a74f7d..63c9d54 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)
-- 
GitLab