rpms/net-snmp/F-9 net-snmp-5.4.1-long-iface-names.patch, NONE, 1.1 net-snmp.spec, 1.151, 1.152
Jan Šafránek
jsafrane at fedoraproject.org
Thu Oct 23 07:53:01 UTC 2008
Author: jsafrane
Update of /cvs/pkgs/rpms/net-snmp/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26604
Modified Files:
net-snmp.spec
Added Files:
net-snmp-5.4.1-long-iface-names.patch
Log Message:
support interface names longer than 8 characters
Resolves: #468045
net-snmp-5.4.1-long-iface-names.patch:
--- NEW FILE net-snmp-5.4.1-long-iface-names.patch ---
468045: Interface name too long: "ioctl 35123 returned -1"
Source: upstream, svn rev. 16797
Support longer interface names.
diff --git a/net-snmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/net-snmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
index 51cde1b..72c1d2d 100644
--- a/net-snmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
+++ b/net-snmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
@@ -189,7 +189,8 @@ _load_v6(netsnmp_container *container, int idx_offset)
return -1;
#else
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;
@@ -229,7 +230,7 @@ _load_v6(netsnmp_container *container, int idx_offset)
* 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 %" 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",
diff --git a/net-snmp/include/net-snmp/library/tools.h b/net-snmp/include/net-snmp/library/tools.h
index 7822855..e57d1ac 100644
--- a/net-snmp/include/net-snmp/library/tools.h
+++ b/net-snmp/include/net-snmp/library/tools.h
@@ -88,6 +88,17 @@ extern "C" {
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
Index: net-snmp.spec
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/F-9/net-snmp.spec,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -r1.151 -r1.152
--- net-snmp.spec 22 Jul 2008 07:55:05 -0000 1.151
+++ net-snmp.spec 23 Oct 2008 07:52:30 -0000 1.152
@@ -43,6 +43,7 @@
Patch18: net-snmp-5.4.1-hmac-check.patch
Patch19: net-snmp-5.4.1-perl-snprintf.patch
Patch20: net-snmp-5.4.1-perl-set.patch
+Patch21: net-snmp-5.4.1-long-iface-names.patch
Requires(pre): chkconfig
Requires(post): chkconfig
@@ -177,6 +178,7 @@
%patch18 -p1 -b .hmac-check
%patch19 -p3 -b .perl-snprintf
%patch20 -p1 -b .perl-set
+%patch21 -p2 -b .long-iface-names
# Do this patch with a perl hack...
perl -pi -e "s|'\\\$install_libdir'|'%{_libdir}'|" ltmain.sh
@@ -395,6 +397,7 @@
%changelog
* Tue Jul 22 2008 Jan Safranek <jsafranek at redhat.com> 5.4.1-19
- fix perl SNMP::Session::set (#452131)
+- support interface names longer than 8 characters (#468045)
* Tue Jun 10 2008 Jan Safranek <jsafranek at redhat.com> 5.4.1-18
- explicitly require lm_sensor > 3 for build (#442718)
More information about the fedora-extras-commits
mailing list