[packages] net-snmp: Enable UDP IPv6 transport (closes #5338)
authorVasilis Tsiligiannis <acinonyx@openwrt.gr>
Sun, 12 Jul 2009 15:37:48 +0000 (15:37 +0000)
committerVasilis Tsiligiannis <acinonyx@openwrt.gr>
Sun, 12 Jul 2009 15:37:48 +0000 (15:37 +0000)
SVN-Revision: 16812

libs/net-snmp/Makefile
libs/net-snmp/files/snmpd.conf
libs/net-snmp/files/snmpd.init

index e0322b679058b155a00fcb996cd6d1ecd3af5182..2c374ddc7ea2334013877d5b4e8036c1e62fc0c8 100644 (file)
@@ -141,15 +141,16 @@ SNMP_MIB_MODULES_EXCLUDED = \
        udp-mib \
        utilities \
 
-SNMP_TRANSPORTS_INCLUDED = Callback UDP
+SNMP_TRANSPORTS_INCLUDED = Callback UDP UDPIPv6
 
-SNMP_TRANSPORTS_EXCLUDED = TCP TCPv6 UDPv6 Unix
+SNMP_TRANSPORTS_EXCLUDED = TCP TCPIPv6 Unix
 
 TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
        --enable-shared \
        --enable-static \
+       --enable-ipv6 \
        --with-endianness=little \
        --with-logfile=/var/log/snmpd.log \
        --with-persistent-directory=/usr/lib/snmp/ \
@@ -158,7 +159,6 @@ CONFIGURE_ARGS += \
        --with-sys-location=Unknown \
        --enable-applications \
        --disable-debugging \
-       --disable-ipv6 \
        --disable-manuals \
        --disable-mibs \
        --disable-scripts \
index 2b3cdf01ede9e559da162f08d59d4c34465d3710..099500784d5d577df3a0b5657de8f7fbcd5da372 100644 (file)
@@ -1,3 +1,6 @@
+config agent
+       option agentaddress UDP:161
+
 config com2sec public
        option secname ro
        option source default
index ce04902935ac75ff85864a3cc1ae8446f9568422..24291fc3107b1135e27b9359b90ab22073f2d017 100644 (file)
@@ -9,6 +9,13 @@ RUN_D=/var/run
 PID_F=$RUN_D/snmpd.pid
 RUN_C=$RUN_D/snmpd.conf
 
+snmpd_agent_add() {
+       local cfg="$1"
+
+       config_get agentaddress "$cfg" agentaddress
+       [ -n "$agentaddress" ] || return 0
+       echo "agentaddress $agentaddress" >> $RUN_C
+}
 snmpd_system_add() {
        local cfg="$1"
        config_get syslocation "$cfg" sysLocation
@@ -110,6 +117,7 @@ start() {
 
        config_load snmpd
 
+       config_foreach snmpd_agent_add agent
        config_foreach snmpd_system_add system
        config_foreach snmpd_com2sec_add com2sec
        config_foreach snmpd_group_add group