diff options
author | Erlang/OTP <[email protected]> | 2014-08-07 17:36:26 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2014-08-07 17:36:26 +0200 |
commit | 6828c2ed8fdd5f19cad002a7dae07dd5f1c4409c (patch) | |
tree | d86469ff46b5b7a53f85f245963e1084f8bd3710 /lib/snmp/src/misc/snmp_pdus.erl | |
parent | f68b689662dcfba7f6e82bad03938eeb3a48a300 (diff) | |
parent | e910f8568a4d19093f7ea8c6865367c3e73703f0 (diff) | |
download | otp-6828c2ed8fdd5f19cad002a7dae07dd5f1c4409c.tar.gz otp-6828c2ed8fdd5f19cad002a7dae07dd5f1c4409c.tar.bz2 otp-6828c2ed8fdd5f19cad002a7dae07dd5f1c4409c.zip |
Merge branch 'raimo/snmp/ipv4+ipv6/OTP-12020' into maint-17
* refs/heads/fetch-and-merge.maint-17-opu/FETCH_HEAD/54676: (46 commits)
Fix error printouts to not crash
Improve ct_snmp test cases
Fix misspelled community in manager
Rearrange test suite group structure
Fix testcase for really dual ip
Adjust test cases for daily builds
Fix call to non-existent function
Fix test manager in agent tests for IPv6
Call new Net-SNMP test suite from top suite
Improve external snmp commands args
Test inform to dual transports
Write list of trap targets
Improve dual stack test suite
Use {ipv6_v6only, true}
Remove commented out code
Add dual_ip tests in snmp_to_snmpnet_SUITE
Silence logging from agent net_if at shutdown
Rewrite agent for IPv4 + IPv6
snmp: Add inform test
snmp: Add new test suite
...
Diffstat (limited to 'lib/snmp/src/misc/snmp_pdus.erl')
-rw-r--r-- | lib/snmp/src/misc/snmp_pdus.erl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/snmp/src/misc/snmp_pdus.erl b/lib/snmp/src/misc/snmp_pdus.erl index 15156f7467..90fa4c0dea 100644 --- a/lib/snmp/src/misc/snmp_pdus.erl +++ b/lib/snmp/src/misc/snmp_pdus.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2012. All Rights Reserved. +%% Copyright Ericsson AB 1996-2014. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -174,7 +174,7 @@ dec_pdu_tag(168) -> dec_pdu([164 | Bytes]) -> % It's a trap Bytes2 = get_data_bytes(Bytes), {Enterprise, Rest1} = dec_oid_tag(Bytes2), - {{'IpAddress', AgentAddr}, Rest2} = dec_value(Rest1), + {{'IpAddress', [_, _, _, _] = AgentAddr}, Rest2} = dec_value(Rest1), {GenericTrap, Rest3} = dec_int_tag(Rest2), {SpecificTrap, Rest4} = dec_int_tag(Rest3), {{'TimeTicks', TimeStamp}, VBBytes} = dec_value(Rest4), @@ -664,7 +664,9 @@ enc_value('BITS', Val) -> enc_oct_str_tag(bits_to_str(Val)); enc_value('OBJECT IDENTIFIER', Val) -> enc_oid_tag(Val); -enc_value('IpAddress', Val) -> +enc_value('IpAddress', {A, B, C, D}) -> + enc_value('IpAddress', [A,B,C,D]); +enc_value('IpAddress', Val) when is_list(Val) -> Bytes2 = enc_oct_str_notag(Val), Len2 = elength(length(Bytes2)), lists:append([64 | Len2],Bytes2); |