-
Notifications
You must be signed in to change notification settings - Fork 81
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
[BUG] Unable to set 64 bit integer on 32 bit ARM device #177
Comments
If someone can point me to where this might be triggered in the wrapper I can take a look at fixing it. |
@oschwartz10612 Just out of curiosity does it work on V0.2.6 ?: https://github.com/easysnmp/easysnmp/releases/tag/0.2.6 I would expect what you are doing to work. Maybe something to do with the net-snmp compiled for your arm32 arch... |
Thanks for the response. Forgive me, I am using I am happy to do more testing, but you might need to point me in the right direction about what I should be changing. I can test newer versions of Ubuntu that might have a more updated net-snmp. Admittedly, this is a obscure armv7 device, but with docker this should not matter. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
I did some local testing on a 64-bit Ubuntu 20.04 system using the command-line
I should also note the following output when you use other values:
The behavior of However, what you experience with your value being truncated to 32-bits causes a difference in output. Instead of reading it as -1, it gets rolled down to 2147483647, which is not the same. I would not care if we were truncating values to 32-bit (to be compliant with RFC 2578) if it was at least consistent and correct, but this divergence from Net-SNMP will cause headaches for some. (As a side note, the ever-ambiguous I would still like to see what the output is from a 32-bit version of Lines 3990 to 3995 in d014177
Since the value is out of bounds, the code appears to cap it instead of letting it overflow. I believe the best approach would be to allow the overflow for |
This makes a lot of sense. Thanks for looking into it. I am sorry I got caught up today and couldn't get any testing done. I will do it tomorrow and let you know what I find. |
@oschwartz10612 Just following up on this. Were you able to do the testing that @kamakazikamikaze mentioned? |
Shoot! Sorry; I got caught up and totally forgot to work on this. I will test this first thing tomorrow morning my time and get back to you! Thanks for pinging me. |
Okay, sorry for the delay. @kamakazikamikaze after testing
On 64 bit system:
It looks like similar behavior to easysnmp which is interesting. What would you say is the next step? |
EasySNMP release version: 0.2.6
Operating System and Version
hirsute-20211107
Docker containerNet-SNMP Library Version
Describe the bug
When running a set command on an integer larger than 32 bits, it gets truncated to 2147483647 and sent on 32 bit devices. For example I have a ARM device running easysnmp and when I try to set 4294967295, the manager receives 2147483647. When I try this on my x86_64 desktop it works fine and sets the value as expected.
I suspect this is a 32 bit int problem with the net-snmp wrapper but I dont know for sure. I have only tested this with snmp v1.
To Reproduce
Steps to reproduce the behavior:
On an arm32 (Raspberry Pi) device create a snmp session and run the following command:
session.set(oid="1.3.6.1.4.1.1206.4.2.6.3.3.2.1.4.1", value="4294967295", snmp_type="INTEGER")
Expected behavior
The correct integer should be sent.
The text was updated successfully, but these errors were encountered: