diff options
author | Micael Karlberg <[email protected]> | 2011-05-11 12:11:57 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-05-11 12:11:57 +0200 |
commit | 4dde37d7d40d213ba052a4f6c18b7c257bf93960 (patch) | |
tree | 0c0249721c553720bde8840f3d0001c892e41767 /lib/snmp/src/misc | |
parent | 5b15b32e2d1aec2716c58879f0ada02557c757f5 (diff) | |
download | otp-4dde37d7d40d213ba052a4f6c18b7c257bf93960.tar.gz otp-4dde37d7d40d213ba052a4f6c18b7c257bf93960.tar.bz2 otp-4dde37d7d40d213ba052a4f6c18b7c257bf93960.zip |
Release notes, test case and some minor decode fixes
(allow only 32 bit values when decoding).
Diffstat (limited to 'lib/snmp/src/misc')
-rw-r--r-- | lib/snmp/src/misc/snmp_pdus.erl | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/snmp/src/misc/snmp_pdus.erl b/lib/snmp/src/misc/snmp_pdus.erl index 9c273bc0e0..213d0226b1 100644 --- a/lib/snmp/src/misc/snmp_pdus.erl +++ b/lib/snmp/src/misc/snmp_pdus.erl @@ -268,14 +268,6 @@ dec_value([4 | Bytes]) -> dec_value([64 | Bytes]) -> {Value, Rest} = dec_oct_str_notag(Bytes), {{'IpAddress', Value}, Rest}; -%% dec_value([65 | Bytes]) -> -%% {Value, Rest} = dec_integer_notag(Bytes), -%% if -%% (Value >= 0) andalso (Value =< 4294967295) -> -%% {{'Counter32', Value}, Rest}; -%% true -> -%% exit({error, {bad_counter32, Value}}) -%% end; dec_value([65 | Bytes]) -> %% Counter32 is an unsigned 32 but is actually encoded as %% a signed integer 32 (INTEGER). @@ -284,12 +276,13 @@ dec_value([65 | Bytes]) -> if (Value >= 0) andalso (Value =< 16#ffffffff) -> %% We accept value above 16#7fffffff + %% in order to be backward bug-compatible Value; (Value < 0) -> 16#ffffffff + Value + 1; true -> exit({error, {bad_counter32, Value}}) end, - {{'Counter64', Value2}, Rest}; + {{'Counter32', Value2}, Rest}; dec_value([66 | Bytes]) -> {Value, Rest} = dec_integer_notag(Bytes), if |