Hi Daniel,

nice idea, I would like to use the patch.
The only problem is that not all OS system support this option:

libtool: compile:  gcc -I../include 
-I/Users/clausklein/Workspace/c/net-snmp/build/../include -I. -I../snmplib 
-I/Users/clausklein/Workspace/c/net-snmp/build/../snmplib -DNETSNMP_ENABLE_IPV6 
-fno-strict-aliasing -I/opt/local/include -g -Wall -Wextra -Udarwin13 
-Ddarwin13=darwin13 -Wall -Wstrict-prototypes -Wwrite-strings -Wcast-qual -c 
/Users/clausklein/Workspace/c/net-snmp/build/../snmplib/transports/snmpUDPBaseDomain.c
  -fno-common -DPIC -o transports/.libs/snmpUDPBaseDomain.o
/Users/clausklein/Workspace/c/net-snmp/build/../snmplib/transports/snmpUDPBaseDomain.c:58:45:
 error: use of undeclared identifier
      'SO_BINDTODEVICE'
    if (iface && setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, iface, 
strlen(iface)) == -1)
                                            ^
/Users/clausklein/Workspace/c/net-snmp/build/../snmplib/transports/snmpUDPBaseDomain.c:137:50:
 warning: unused parameter
      'if_index' [-Wunused-parameter]
                         socklen_t *dstlen, int *if_index)
                                                 ^
/Users/clausklein/Workspace/c/net-snmp/build/../snmplib/transports/snmpUDPBaseDomain.c:240:27:
 warning: missing field
      'msg_namelen' initializer [-Wmissing-field-initializers]
    struct msghdr m = { 0 };
                          ^
/Users/clausklein/Workspace/c/net-snmp/build/../snmplib/transports/snmpUDPBaseDomain.c:235:63:
 warning: unused parameter
      'if_index' [-Wunused-parameter]
int netsnmp_udpbase_sendto(int fd, struct in_addr *srcip, int if_index,
                                                              ^
3 warnings and 1 error generated.
make[1]: *** [transports/snmpUDPBaseDomain.lo] Error 1
make: *** [subdirs] Error 1
Claus-MacBook-Pro:build clausklein$ 

Best regards,
Claus

On 16.12.2014, at 17:21, daniel danzberger <dddan...@users.sf.net> wrote:

> 
> [patches:#1296] Bind agent to interface patch
> 
> Status: open
> Group: backport-needed
> Created: Tue Dec 16, 2014 04:21 PM UTC by daniel danzberger
> Last Updated: Tue Dec 16, 2014 04:21 PM UTC
> Owner: nobody
> 
> This patch adds the config parameter 'listendevice'
> 
> It uses the setsockopt SO_BINDTODEVICE option to bind the snmpd to an 
> specific network interface.
> This is required for forcing the snmpd to be available on only one interface, 
> that's
> address is not fix.
> 
> snmpd.conf example:
> 
> ...
> agentaddress UDP:161
> listendevice eth0
> ...
> 
> Version: 5.8.dev
> git (master): 2465d106bcb4ab478b939e3e3bc808716026af9d
> 
> Future:
> - This could be implemented in the agentaddress option string.
> - Allowing more than one interface.
> 
> Please apply.
> 
> Sent from sourceforge.net because you indicated interest in 
> https://sourceforge.net/p/net-snmp/patches/1296/
> 
> To unsubscribe from further messages, please visit 
> https://sourceforge.net/auth/subscriptions/
> 

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to