~ubuntu-branches/ubuntu/precise/net-snmp/precise

« back to all changes in this revision

Viewing changes to debian/patches/46_ifname_crop.patch

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-11-26 01:27:00 UTC
  • mfrom: (1.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20091126012700-pox7w0a5j2x305h9
Tags: 5.4.2.1~dfsg-3ubuntu1
* Merge from debian testing.  Remaining changes:
  - Set Ubuntu maintainer address.
  - net-snmp-config: Use bash. (LP: #104738)
  - Removed multiuser option when calling update-rc.d. (LP: #254261)
  - debian/snmpd.init: LSBify the init script.
  - debian/patches/52_fix_snmpcmd_1_typo.patch: Adjust a typo in snmpcmd.1
    (LP: #250459)
  - debian/patches/99-fix-ubuntu-div0.patch: Fix dvision by zero.
    (LP: #426813).
 * Dropped patches:
   - debian/patches/101-fix-ipalias.patch: Applied upstream.
   - debian/patches/99-fix-net-snmp-syslog.patch: Applied upstream.
   - debian/patches/99-fix-perl-counter-in-subagent.patch: Applied upstream.
   - ebian/patches/103-fix-ubuntu-lmsensors.patch: No longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--- net-snmp-5.4.1~dfsg.orig/include/net-snmp/library/tools.h   (Revision 16796)
2
 
+++ net-snmp-5.4.1~dfsg/include/net-snmp/library/tools.h        (Revision 16797)
3
 
@@ -88,6 +88,17 @@
4
 
     Computers the minimum of a and b. */
5
 
 #define SNMP_MIN(a,b) ((a) > (b) ? (b) : (a))
6
 
 
7
 
+/** @def SNMP_MACRO_VAL_TO_STR(s)
8
 
+ *  Expands to string with value of the s. 
9
 
+ *  If s is macro, the resulting string is value of the macro.
10
 
+ *  Example: 
11
 
+ *   #define TEST 1234
12
 
+ *   SNMP_MACRO_VAL_TO_STR(TEST) expands to "1234"
13
 
+ *   SNMP_MACRO_VAL_TO_STR(TEST+1) expands to "1234+1"
14
 
+ */
15
 
+#define SNMP_MACRO_VAL_TO_STR(s) SNMP_MACRO_VAL_TO_STR_PRIV(s)  
16
 
+#define SNMP_MACRO_VAL_TO_STR_PRIV(s) #s
17
 
+       
18
 
 #ifndef FALSE
19
 
 #define FALSE 0
20
 
 #endif
21
 
--- net-snmp-5.4.1~dfsg.orig/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c        (Revision 16796)
22
 
+++ net-snmp-5.4.1~dfsg/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c     (Revision 16797)
23
 
@@ -180,7 +180,8 @@
24
 
 _load_v6(netsnmp_container *container, int idx_offset)
25
 
 {
26
 
     FILE           *in;
27
 
-    char            line[80], addr[40], if_name[IFNAMSIZ];
28
 
+    char            line[80], addr[40];
29
 
+    char            if_name[IFNAMSIZ+1];/* +1 for '\0' because of the ugly sscanf below */ 
30
 
     u_char          *buf;
31
 
     int             if_index, pfx_len, scope, flags, rc = 0;
32
 
     size_t          in_len, out_len;
33
 
@@ -219,7 +220,7 @@
34
 
          * F: flags (see include/linux/rtnetlink.h, net/ipv6/addrconf.c)
35
 
          * I: interface
36
 
          */
37
 
-        rc = sscanf(line, "%39s %02x %02x %02x %02x %8s\n",
38
 
+        rc = sscanf(line, "%39s %02x %02x %02x %02x %" SNMP_MACRO_VAL_TO_STR(IFNAMSIZ) "s\n",
39
 
                     addr, &if_index, &pfx_len, &scope, &flags, if_name);
40
 
         if( 6 != rc ) {
41
 
             snmp_log(LOG_ERR, PROCFILE " data format error (%d!=6), line ==|%s|\n",