[erlang-bugs] bind_to is ignored in snmpm_net_if

Pavel Baturko pabftk@REDACTED
Mon Sep 29 11:29:54 CEST 2014


Hi,

I'm looking into erlang snmp manager code because my manager stops working
when I updated erlang from 17.1 to 17.3.

The problem is that in otp/lib/snmp/src/manager/snmpm_net_if.erl (github
erlang/otp, branch maint) in function socket_params parameter BindTo is
ignored in case of Family==inet and init
:get_argument(snmp_fd)==error:

socket_params(Domain, {IpAddr, IpPort}, BindTo, CommonSocketOpts) ->
    ...
    case Family of
    inet ->
        case init:get_argument(snmp_fd) of
        {ok, [[FdStr]]} ->
            ...
        error ->
            {IpPort, [{ip, IpAddr} | SocketOpts]} <<<<<<<< *
        end;
    _ ->
        ...
    end.

*: here ip option is added regardless of BindTo argument.

in other cases branches this option is utilized.

When address option is not specified in manager.conf snmp manager uses
127.0.0.1 as default and socket is binding to 127.0.0.1. After that all
gen_upd:send fails with einval.

Thanks,
Pavel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140929/9d8f0b99/attachment.htm>


More information about the erlang-bugs mailing list