diff options
author | Raimo Niskanen <[email protected]> | 2014-09-30 12:10:05 +0200 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2014-09-30 12:26:00 +0200 |
commit | 517a51c3e4ab49302daea27592e875fb09f3091b (patch) | |
tree | efa9a50544bd8048744b52e9115054b6e93d546d /lib/snmp/src | |
parent | 743ed31108ee555db18d9833186865e85e34333e (diff) | |
download | otp-517a51c3e4ab49302daea27592e875fb09f3091b.tar.gz otp-517a51c3e4ab49302daea27592e875fb09f3091b.tar.bz2 otp-517a51c3e4ab49302daea27592e875fb09f3091b.zip |
Honor bind_to for manager net_if family inet
Bug reported by Pavel Baturko to erlang-bugs.
Diffstat (limited to 'lib/snmp/src')
-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) -> |