aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmpa_net_if.erl
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2014-05-08 16:16:03 +0200
committerRaimo Niskanen <[email protected]>2014-07-25 12:15:14 +0200
commit100b3345793043d50f90619c25123dc4d218e5cd (patch)
treefe3c11da9c4c905f1e7528b6079509bdeb10803c /lib/snmp/src/agent/snmpa_net_if.erl
parentd2002049e348f1da8d011fe5f628484ec909ec41 (diff)
downloadotp-100b3345793043d50f90619c25123dc4d218e5cd.tar.gz
otp-100b3345793043d50f90619c25123dc4d218e5cd.tar.bz2
otp-100b3345793043d50f90619c25123dc4d218e5cd.zip
fix agent configuration details
Diffstat (limited to 'lib/snmp/src/agent/snmpa_net_if.erl')
-rw-r--r--lib/snmp/src/agent/snmpa_net_if.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/snmp/src/agent/snmpa_net_if.erl b/lib/snmp/src/agent/snmpa_net_if.erl
index 59d88517c9..96211fc5f4 100644
--- a/lib/snmp/src/agent/snmpa_net_if.erl
+++ b/lib/snmp/src/agent/snmpa_net_if.erl
@@ -112,6 +112,14 @@ get_address() ->
{value, IPAddress} = snmp_framework_mib:intAgentIpAddress(get),
IPAddress.
+get_domain() ->
+ case snmp_framework_mib:intAgentTransportDomain(get) of
+ {value, Domain} ->
+ Domain;
+ genErr ->
+ snmpUDPDomain
+ end.
+
filter_reset(Pid) ->
Pid ! filter_reset.
@@ -155,6 +163,8 @@ do_init(Prio, NoteStore, MasterAgent, Parent, Opts) ->
?vlog("starting",[]),
%% -- Port and address --
+ Domain = get_domain(),
+ ?vdebug("domain: ~w",[Domain]),
UDPPort = get_port(),
?vdebug("port: ~w",[UDPPort]),
IPAddress = get_address(),
@@ -181,7 +191,9 @@ do_init(Prio, NoteStore, MasterAgent, Parent, Opts) ->
IPOpts2 = ip_opt_no_reuse_address(Opts),
IPOpts3 = ip_opt_recbuf(Opts),
IPOpts4 = ip_opt_sndbuf(Opts),
- IPOpts = [binary | IPOpts1 ++ IPOpts2 ++ IPOpts3 ++ IPOpts4],
+ IPOpts =
+ [binary, snmp_conf:tdomain_to_family(Domain)
+ | IPOpts1 ++ IPOpts2 ++ IPOpts3 ++ IPOpts4],
?vdebug("open socket with options: ~w",[IPOpts]),
case gen_udp_open(UDPPort, IPOpts) of
{ok, Sock} ->