diff options
-rw-r--r-- | lib/snmp/src/manager/snmpm_net_if.erl | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/snmp/src/manager/snmpm_net_if.erl b/lib/snmp/src/manager/snmpm_net_if.erl index cb72871177..b4cc165d2e 100644 --- a/lib/snmp/src/manager/snmpm_net_if.erl +++ b/lib/snmp/src/manager/snmpm_net_if.erl @@ -319,7 +319,7 @@ socket_open(IpPort, SocketOpts) -> Socket end. -socket_params(Domain, {IpAddr, IpPort}, BindTo, CommonSocketOpts) -> +socket_params(Domain, {IpAddr, IpPort} = Addr, BindTo, CommonSocketOpts) -> Family = snmp_conf:tdomain_to_family(Domain), SocketOpts = case Family of @@ -340,15 +340,18 @@ socket_params(Domain, {IpAddr, IpPort}, BindTo, CommonSocketOpts) -> {0, [{fd, Fd} | SocketOpts]} end; error -> - {IpPort, [{ip, IpAddr} | SocketOpts]} + socket_params(SocketOpts, Addr, BindTo) end; _ -> - case BindTo of - true -> - {IpPort, [{ip, IpAddr} | SocketOpts]}; - _ -> - {IpPort, SocketOpts} - end + socket_params(SocketOpts, Addr, BindTo) + end. +%% +socket_params(SocketOpts, {IpAddr, IpPort}, BindTo) -> + case BindTo of + true -> + {IpPort, [{ip, IpAddr} | SocketOpts]}; + _ -> + {IpPort, SocketOpts} end. common_socket_opts(Opts) -> |