[Pkg-net-snmp-commits] r242 - branches/net-snmp54/debian/patches

jochen at alioth.debian.org jochen at alioth.debian.org
Tue Jun 3 11:17:48 UTC 2008


Author: jochen
Date: 2008-06-03 11:17:47 +0000 (Tue, 03 Jun 2008)
New Revision: 242

Modified:
   branches/net-snmp54/debian/patches/46_ifname_crop.README
   branches/net-snmp54/debian/patches/46_ifname_crop.patch
Log:
Update interface name patch to upstream version


Modified: branches/net-snmp54/debian/patches/46_ifname_crop.README
===================================================================
--- branches/net-snmp54/debian/patches/46_ifname_crop.README	2008-06-03 11:17:02 UTC (rev 241)
+++ branches/net-snmp54/debian/patches/46_ifname_crop.README	2008-06-03 11:17:47 UTC (rev 242)
@@ -1 +1 @@
-Upstream PATCH 1954198: raise interface name limit on linux to 16 characters
+Upstream Changeset 16797: snmpd: PATCH: 1826102: from jsafranek: support longer interface names on linux

Modified: branches/net-snmp54/debian/patches/46_ifname_crop.patch
===================================================================
--- branches/net-snmp54/debian/patches/46_ifname_crop.patch	2008-06-03 11:17:02 UTC (rev 241)
+++ branches/net-snmp54/debian/patches/46_ifname_crop.patch	2008-06-03 11:17:47 UTC (rev 242)
@@ -1,12 +1,41 @@
---- net-snmp-5.4.1~dfsg.orig/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
-+++ net-snmp-5.4.1~dfsg/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
-@@ -219,7 +219,7 @@
+--- net-snmp-5.4.1~dfsg.orig/include/net-snmp/library/tools.h	(Revision 16796)
++++ net-snmp-5.4.1~dfsg/include/net-snmp/library/tools.h	(Revision 16797)
+@@ -88,6 +88,17 @@
+     Computers the minimum of a and b. */
+ #define SNMP_MIN(a,b) ((a) > (b) ? (b) : (a))
+ 
++/** @def SNMP_MACRO_VAL_TO_STR(s)
++ *  Expands to string with value of the s. 
++ *  If s is macro, the resulting string is value of the macro.
++ *  Example: 
++ *   #define TEST 1234
++ *   SNMP_MACRO_VAL_TO_STR(TEST) expands to "1234"
++ *   SNMP_MACRO_VAL_TO_STR(TEST+1) expands to "1234+1"
++ */
++#define SNMP_MACRO_VAL_TO_STR(s) SNMP_MACRO_VAL_TO_STR_PRIV(s)  
++#define SNMP_MACRO_VAL_TO_STR_PRIV(s) #s
++	
+ #ifndef FALSE
+ #define FALSE 0
+ #endif
+--- net-snmp-5.4.1~dfsg.orig/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c	(Revision 16796)
++++ net-snmp-5.4.1~dfsg/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c	(Revision 16797)
+@@ -180,7 +180,8 @@
+ _load_v6(netsnmp_container *container, int idx_offset)
+ {
+     FILE           *in;
+-    char            line[80], addr[40], if_name[IFNAMSIZ];
++    char            line[80], addr[40];
++    char            if_name[IFNAMSIZ+1];/* +1 for '\0' because of the ugly sscanf below */ 
+     u_char          *buf;
+     int             if_index, pfx_len, scope, flags, rc = 0;
+     size_t          in_len, out_len;
+@@ -219,7 +220,7 @@
           * F: flags (see include/linux/rtnetlink.h, net/ipv6/addrconf.c)
           * I: interface
           */
 -        rc = sscanf(line, "%39s %02x %02x %02x %02x %8s\n",
-+        rc = sscanf(line, "%39s %02x %02x %02x %02x %16s\n",
++        rc = sscanf(line, "%39s %02x %02x %02x %02x %" SNMP_MACRO_VAL_TO_STR(IFNAMSIZ) "s\n",
                      addr, &if_index, &pfx_len, &scope, &flags, if_name);
          if( 6 != rc ) {
              snmp_log(LOG_ERR, PROCFILE " data format error (%d!=6), line ==|%s|\n",
-




More information about the Pkg-net-snmp-commits mailing list