diff --git a/scapy/layers/llmnr.py b/scapy/layers/llmnr.py
index cc84feee006fc89d0f3036dd1b890ac37630fcd9..62be5226e7a30a2ef384169daeac9284a3932060 100644
--- a/scapy/layers/llmnr.py
+++ b/scapy/layers/llmnr.py
@@ -32,7 +32,7 @@ class LLMNRQuery(Packet):
                     DNSRRField("ar", "arcount",0)]
     overload_fields = {UDP: {"sport": 5355, "dport": 5355 }}
     def hashret(self):
-        return struct.pack("!H", id)
+        return struct.pack("!H", self.id)
 
 class LLMNRResponse(LLMNRQuery):
     name = "Link Local Multicast Node Resolution - Response"