Hope this posting is OK although I'm not on this list.

With Linux 2.6 IPv6 came a tunnel interface, "ip6tnl0".

It breaks the code that extracts interface #, since that algorithm
stops at the first digit and takes the rest as #, i.e. <ip><6tnl0>.

I think the "diff -c" below is an appropriate fix.

        Gunnar Lindberg

*** ./agent/mibgroup/mibII/interfaces.c.ORIG    Mon Jan  3 16:51:32 2005
--- ./agent/mibgroup/mibII/interfaces.c Fri May 27 06:04:06 2005
***************
*** 1574,1581 ****
--- 1574,1597 ----
           * set name and interface# : 
           */
          nnew->if_name = (char *) strdup(ifname);
+ #ifdef        notdef
+       /* this fails for e.g. "ip6tnl0"                        */
          for (ptr = nnew->if_name; *ptr && (*ptr < '0' || *ptr > '9');
               ptr++);
+ #endif        /* notdef */
+ 
+       ptr = nnew->if_name;
+       /* start from end of string                             */
+       while (*ptr)
+           ptr++;
+       /* trailing digits are interface #                      */
+       while (ptr != nnew->if_name)
+       {
+           ptr--;
+           if (*ptr < '0' || *ptr > '9')
+               break;
+       }
+       ptr++;
          nnew->if_unit = strdup(*ptr ? ptr : "");
          *ptr = 0;
  


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to