diff --git a/tests/hwsim/radius_das.py b/tests/hwsim/radius_das.py index 300681a71..58dc9d6fa 100644 --- a/tests/hwsim/radius_das.py +++ b/tests/hwsim/radius_das.py @@ -16,7 +16,10 @@ class DisconnectPacket(pyrad.packet.Packet): **attributes) def RequestPacket(self): - attr = self._PktEncodeAttributes() + attr = b'' + for code,datalst in sorted(self.items()): + for data in datalst: + attr += self._PktEncodeAttribute(code, data) if self.id is None: self.id = random.randrange(0, 256) diff --git a/tests/hwsim/test_radius.py b/tests/hwsim/test_radius.py index 144ad83b3..1ab343f5a 100644 --- a/tests/hwsim/test_radius.py +++ b/tests/hwsim/test_radius.py @@ -730,7 +730,10 @@ def add_message_auth_req(req): # request attributes req.AddAttribute("Message-Authenticator", 16*b"\x00") - attrs = req._PktEncodeAttributes() + attrs = b'' + for code,datalst in sorted(req.items()): + for data in datalst: + attrs += req._PktEncodeAttribute(code, data) # Length flen = 4 + 16 + len(attrs)