On Thu, 23 Aug 2007 14:09:56 -0400 [EMAIL PROTECTED] wrote:
SC> Unforutnately, I am not a C programmer so I was hoping the guys who
SC> wrote this cool piece of software can help me this...
SC> 
SC> > The SIOCGIFNETMASK ioctl for eth1:1 fails. I have no idea whether this
SC> > is expected behaviour for an interface alias or not.

This is just a quick, untested shot in the dark. Let us know if it helps..

Index: agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
===================================================================
--- agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c (revision 16710)
+++ agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c (working copy)
@@ -238,6 +238,10 @@
         /*
          * get netmask
          */
+        if (entry->flags & NETSNMP_ACCESS_IPADDRESS_ISALIAS) {
+            memset(si->sin_addr.s_addr, 0x00, sizeof(si->sin_addr.s_addr));
+            entry->ia_prefix_len = 0;
+        } else {
         ifrp->ifr_addr = save_addr;
         if (ioctl(sd, SIOCGIFNETMASK, ifrp) < 0) {
             snmp_log(LOG_ERR,
@@ -249,6 +253,7 @@
         si = (struct sockaddr_in *) &ifrp->ifr_addr;
         entry->ia_prefix_len =
             netsnmp_ipaddress_ipv4_prefix_len(ntohl(si->sin_addr.s_addr));
+        }
         if(addr_info.bcastflg)
            bcastentry->ia_prefix_len = entry->ia_prefix_len;


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to