From c19df5a77ad8006911ba74ad0bdcf76e60078a93 Mon Sep 17 00:00:00 2001 From: amartin-git <70332648+amartin-git@users.noreply.github.com> Date: Mon, 6 Dec 2021 12:26:22 -0500 Subject: [PATCH] Set larger receive buffer size for bulk requests When using SNMP BULK GET requests (from Zabbix in our case), the default value of 1024 truncates the request, resulting in malformed requests reaching the agent. Using an 8K buffer fixes this. A better approach perhaps would be to process the buffer using a loop. --- agentx/network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agentx/network.py b/agentx/network.py index 430c64e..7aef94d 100644 --- a/agentx/network.py +++ b/agentx/network.py @@ -97,7 +97,7 @@ class Network(): self.socket.send(pdu.encode()) def recv_pdu(self): - buf = self.socket.recv(1024) + buf = self.socket.recv(8192) if not buf: return None pdu = PDU() pdu.decode(buf)