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)
4
Computers the minimum of a and b. */
5
#define SNMP_MIN(a,b) ((a) > (b) ? (b) : (a))
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.
12
+ * SNMP_MACRO_VAL_TO_STR(TEST) expands to "1234"
13
+ * SNMP_MACRO_VAL_TO_STR(TEST+1) expands to "1234+1"
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
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)
24
_load_v6(netsnmp_container *container, int idx_offset)
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 */
31
int if_index, pfx_len, scope, flags, rc = 0;
32
size_t in_len, out_len;
34
* F: flags (see include/linux/rtnetlink.h, net/ipv6/addrconf.c)
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);
41
snmp_log(LOG_ERR, PROCFILE " data format error (%d!=6), line ==|%s|\n",