From: Paweł Sikora Date: Mon, 20 Jun 2011 19:56:46 +0000 (+0000) Subject: - peek & read netlink message in one shot since the default algorithm doesn't work... X-Git-Tag: auto/th/ggaoed-1_1-2 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fggaoed.git;a=commitdiff_plain;h=refs%2Ftags%2Fauto%2Fth%2Fggaoed-1_1-2 - peek & read netlink message in one shot since the default algorithm doesn't work for multiple buffer resizing. - release 2. Changed files: ggaoed-netlink-rx-buffer-realloc.patch -> 1.1 ggaoed.spec -> 1.6 --- diff --git a/ggaoed-netlink-rx-buffer-realloc.patch b/ggaoed-netlink-rx-buffer-realloc.patch new file mode 100644 index 0000000..b15c51a --- /dev/null +++ b/ggaoed-netlink-rx-buffer-realloc.patch @@ -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)) diff --git a/ggaoed.spec b/ggaoed.spec index e556cde..418ba1f 100644 --- a/ggaoed.spec +++ b/ggaoed.spec @@ -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