rpms/amtu/devel amtu-1.0.4-cleanup.patch, NONE, 1.1 amtu.spec, 1.15, 1.16

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Jan 9 23:20:46 UTC 2007


Author: sgrubb

Update of /cvs/dist/rpms/amtu/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv29773

Modified Files:
	amtu.spec 
Added Files:
	amtu-1.0.4-cleanup.patch 
Log Message:
* Tue Jan 9 2007 Steve Grubb <sgrubb at redhat.com> 1.0.4-4
- patch fixing network and disk tests


amtu-1.0.4-cleanup.patch:
 iodisktest.c |    3 ++-
 networkio.c  |   11 +++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

--- NEW FILE amtu-1.0.4-cleanup.patch ---
diff -urp amtu-1.0.4.orig/src/iodisktest.c amtu-1.0.4/src/iodisktest.c
--- amtu-1.0.4.orig/src/iodisktest.c	2007-01-09 15:41:48.000000000 -0500
+++ amtu-1.0.4/src/iodisktest.c	2007-01-09 16:32:38.000000000 -0500
@@ -74,6 +74,7 @@
 #define MAXLINE 500
 #define MAXINDEX 100
 #define MAXMEMSIZE 10485670
+#define BDEVNAME_SIZE 32 
 
 // Structure to track info about partitions
 typedef struct {
@@ -279,7 +280,7 @@ int iodisktest(int argc, char *argv[])
 	FILE *fname;  
 	FILE *fs;                
 	FILE *fs1;           	
-	char token[10];            
+	char token[BDEVNAME_SIZE]; 
 	char line[MAXLINE]; 
 	int num = 32;    
 	int num_of_rands = 0;
diff -urp amtu-1.0.4.orig/src/networkio.c amtu-1.0.4/src/networkio.c
--- amtu-1.0.4.orig/src/networkio.c	2007-01-09 15:41:48.000000000 -0500
+++ amtu-1.0.4/src/networkio.c	2007-01-09 17:26:28.000000000 -0500
@@ -208,6 +208,10 @@ int get_interfaces()
 	
 	ifr = ifc.ifc_req;
 	numifs = ifc.ifc_len/sizeof (struct ifreq);
+	if (numifs > MAX_INTERFACES) {
+		printf("Too many interfaces, only testing the first %d\n", MAX_INTERFACES);
+		numifs = MAX_INTERFACES;
+	}
 	if (debug)
 		printf("SIOCGIFCONF has %d interfaces in list:\n", numifs);
 
@@ -231,6 +235,7 @@ int get_interfaces()
 		memset(&ifr_sub, '\0', sizeof(struct ifreq));
 		strncpy(ifr_sub.ifr_name, ifr->ifr_name,
 			sizeof(ifr_sub.ifr_name));
+		ifr_sub.ifr_name[sizeof(ifr_sub.ifr_name)-1] = 0;
 		if (ioctl(sock, SIOCGIFFLAGS, (char *)&ifr_sub) < 0) {
 			fprintf(stderr, "SIOCGIFFLAGS failed for %s.\n", 
 				ifr->ifr_name);
@@ -287,7 +292,7 @@ int get_interfaces()
 		}
 			
 		np->ifindex = ifr_sub.ifr_ifindex;
-		np->ifname = (char *)malloc(sizeof(ifr->ifr_name));
+		np->ifname = strdup(ifr->ifr_name);
 		if (np->ifname == NULL)
 		{
 			fprintf(stderr, "get_interfaces: malloc failed\n");
@@ -302,8 +307,6 @@ int get_interfaces()
 			return -1;
 		}
 
-		strncpy(np->ifname, ifr->ifr_name, sizeof(ifr->ifr_name));
-
 		if (ioctl(sock, SIOCGIFHWADDR, &ifr_sub) < 0) {
 			fprintf(stderr, "SIOCGIFHWADDR failed for %s.\n", 
 				ifr_sub.ifr_name);
@@ -403,7 +406,6 @@ int networkio(int argc, char *argv[])
 		 */
 		bzero(packetbuf, sizeof(packetbuf));
 		bzero(&from, sizeof(from));
-		len = sizeof(from);
 		rsock_fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_LOOP));
 		
 		memset(&rcv_info, 0, sizeof(rcv_info));
@@ -449,6 +451,7 @@ int networkio(int argc, char *argv[])
 		 */
 		count = 0;	
 		do {
+			len = sizeof(from);
 			cc = recvfrom(rsock_fd, packetbuf, sizeof(packetbuf),
 				MSG_DONTWAIT, (struct sockaddr *)&from, &len);
 			


Index: amtu.spec
===================================================================
RCS file: /cvs/dist/rpms/amtu/devel/amtu.spec,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- amtu.spec	12 Jul 2006 05:08:50 -0000	1.15
+++ amtu.spec	9 Jan 2007 23:20:44 -0000	1.16
@@ -1,10 +1,11 @@
 Summary: Abstract Machine Test Utility (AMTU)
 Name: amtu 
 Version: 1.0.4
-Release: 3.1
+Release: 4%{?dist}
 License: Common Public License
 Group: System Environment/Base
 Source0: %{name}-%{version}.tar.gz
+Patch1: amtu-1.0.4-cleanup.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildRequires: audit-libs-devel >= 1.1.2
 BuildRequires: automake
@@ -21,6 +22,7 @@
 
 %prep
 %setup
+%patch1 -p1
 
 %build
 # Determine appropriate compiler
@@ -61,6 +63,9 @@
 %attr(0644,root,root) %{_mandir}/man8/*
 
 %changelog
+* Tue Jan 9 2007 Steve Grubb <sgrubb at redhat.com> 1.0.4-4
+- patch fixing network and disk tests
+
 * Wed Jul 12 2006 Jesse Keating <jkeating at redhat.com> - 1.0.4-3.1
 - rebuild
 




More information about the fedora-cvs-commits mailing list