packages: ggaoed/ggaoed.spec, ggaoed/ggaoed-netlink-rx-buffer-realloc.patch...

pluto pluto at pld-linux.org
Mon Jun 20 21:56:51 CEST 2011


Author: pluto                        Date: Mon Jun 20 19:56:51 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- peek & read netlink message in one shot since the default algorithm doesn't work for multiple buffer resizing.
- release 2.

---- Files affected:
packages/ggaoed:
   ggaoed.spec (1.5 -> 1.6) , ggaoed-netlink-rx-buffer-realloc.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/ggaoed/ggaoed.spec
diff -u packages/ggaoed/ggaoed.spec:1.5 packages/ggaoed/ggaoed.spec:1.6
--- packages/ggaoed/ggaoed.spec:1.5	Wed Feb  2 19:06:00 2011
+++ packages/ggaoed/ggaoed.spec	Mon Jun 20 21:56:46 2011
@@ -2,7 +2,7 @@
 Summary:	ggaoed - ATA over Ethernet target implementation for Linux
 Name:		ggaoed
 Version:	1.1
-Release:	1
+Release:	2
 License:	GPL v2
 Group:		Networking/Daemons
 Source0:	http://ggaoed.googlecode.com/files/%{name}-%{version}.tar.gz
@@ -10,6 +10,7 @@
 Source1:	%{name}.init
 Source2:	%{name}.sysconfig
 Patch0:		%{name}-build.patch
+Patch1:		%{name}-netlink-rx-buffer-realloc.patch
 URL:		http://code.google.com/p/ggaoed/
 BuildRequires:	docbook2X >= 0.8
 BuildRequires:	glib2-devel >= 2.12
@@ -30,6 +31,7 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %configure
@@ -83,6 +85,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.6  2011/06/20 19:56:46  pluto
+- peek & read netlink message in one shot since the default algorithm doesn't work for multiple buffer resizing.
+- release 2.
+
 Revision 1.5  2011/02/02 18:06:00  sparky
 - BR: libblkid-devel, pkgconfig
 

================================================================
Index: packages/ggaoed/ggaoed-netlink-rx-buffer-realloc.patch
diff -u /dev/null packages/ggaoed/ggaoed-netlink-rx-buffer-realloc.patch:1.1
--- /dev/null	Mon Jun 20 21:56:51 2011
+++ packages/ggaoed/ggaoed-netlink-rx-buffer-realloc.patch	Mon Jun 20 21:56:46 2011
@@ -0,0 +1,29 @@
+--- ggaoed-1.1/netlink.c.orig	2011-06-20 19:57:17.000000000 +0200
++++ ggaoed-1.1/netlink.c	2011-06-20 20:27:47.426951722 +0200
+@@ -174,7 +174,7 @@
+ 	int len;
+ 
+ 	addrlen = sizeof(from_addr);
+-	len = recvfrom(nl_fd, recvbuf, recvlen, MSG_TRUNC | MSG_DONTWAIT,
++	len = recvfrom(nl_fd, recvbuf, recvlen, MSG_TRUNC | MSG_DONTWAIT | MSG_PEEK,
+ 		(struct sockaddr *)&from_addr, &addrlen);
+ 	if (!len)
+ 		return;
+@@ -185,13 +185,12 @@
+ 	}
+ 	if (len > recvlen)
+ 	{
+-		/* The buffer was too small. Increase it and request a
+-		 * new enumeration */
+-		recvlen <<= 1;
++		/* The buffer was too small. Increase it and try again... */
++		recvlen = len;
+ 		recvbuf = g_realloc(recvbuf, recvlen);
+-		netmon_enumerate();
+-		return;
+ 	}
++	len = recvfrom(nl_fd, recvbuf, recvlen, MSG_TRUNC | MSG_DONTWAIT,
++		(struct sockaddr *)&from_addr, &addrlen);
+ 
+ 	for (msg = (struct nlmsghdr *)recvbuf; NLMSG_OK(msg, (unsigned)len);
+ 			msg = NLMSG_NEXT(msg, len))
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/ggaoed/ggaoed.spec?r1=1.5&r2=1.6&f=u



More information about the pld-cvs-commit mailing list