Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response packets larger than 4096 bytes are not handled properly. #45

Closed
exhuma opened this issue Jun 14, 2018 · 1 comment
Closed

Response packets larger than 4096 bytes are not handled properly. #45

exhuma opened this issue Jun 14, 2018 · 1 comment

Comments

@exhuma
Copy link
Owner

exhuma commented Jun 14, 2018

When a response is larger than 4096 bytes, the following error is raised:

[...]
  File "/home/users/malbert/work/private/puresnmp/puresnmp/api/pythonic.py", line 183, in bulkwalk
    for oid, value in result:
  File "/home/users/malbert/work/private/puresnmp/puresnmp/api/pythonic.py", line 117, in multiwalk
    for oid, value in raw_output:
  File "/home/users/malbert/work/private/puresnmp/puresnmp/api/raw.py", line 203, in multiwalk
    timeout)
  File "/home/users/malbert/work/private/puresnmp/puresnmp/api/raw.py", line 408, in fetcher
    port=port, timeout=timeout)
  File "/home/users/malbert/work/private/puresnmp/puresnmp/api/raw.py", line 367, in bulkget
    raw_response = Sequence.from_bytes(response)
  File "/home/users/malbert/work/private/puresnmp/puresnmp/x690/types.py", line 153, in from_bytes
    cls, expected_length, len(data)))
ValueError: Corrupt packet: Unexpected length for <class 'puresnmp.x690.types.Sequence'> Expected 6501 (0x1965) but got 4092 (0xffc)

This is due to the way sock.recv is used in puresnmp.transport. It only fetches one chunk and does not continue reading after that.

@exhuma
Copy link
Owner Author

exhuma commented Jul 4, 2018

Closed in last commit and released as hotfix release 1.2.2. Patch has also been applied to the release branch 1.3.0 but it's not released yet. It will be included in 1.3.0rc6

@exhuma exhuma closed this as completed Jul 4, 2018
exhuma added a commit that referenced this issue Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant