]> git.pld-linux.org Git - packages/ggaoed.git/commitdiff
- peek & read netlink message in one shot since the default algorithm doesn't work... master auto/th/ggaoed-1_1-2
authorPaweł Sikora <pluto@pld-linux.org>
Mon, 20 Jun 2011 19:56:46 +0000 (19:56 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- release 2.

Changed files:
    ggaoed-netlink-rx-buffer-realloc.patch -> 1.1
    ggaoed.spec -> 1.6

ggaoed-netlink-rx-buffer-realloc.patch [new file with mode: 0644]
ggaoed.spec

diff --git a/ggaoed-netlink-rx-buffer-realloc.patch b/ggaoed-netlink-rx-buffer-realloc.patch
new file mode 100644 (file)
index 0000000..b15c51a
--- /dev/null
@@ -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))
index e556cdef71d4424b20f163cb56a4742252aa752e..418ba1fe56df8b577e9e971edc437de4bbb58061 100644 (file)
@@ -1,7 +1,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
@@ -9,6 +9,7 @@ Source0:        http://ggaoed.googlecode.com/files/%{name}-%{version}.tar.gz
 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
@@ -29,6 +30,7 @@ features to provide the best performance.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %configure
This page took 0.077227 seconds and 4 git commands to generate.