[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#550401: marked as done (return value of write ignored in nstx_tuntap.c)

Your message dated 
with message-id <20100909203528.4772.62981.mass-bugs-close@merkel.debian.org>
and subject line nstx removed from Debian unstable
has caused the Debian Bug report #550401,
regarding return value of write ignored in nstx_tuntap.c
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org

550401: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550401
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: nstx
Version: 1.1-beta6-5
Severity: normal
Tags: patch


just found this when trying to build nstx on an Ubuntu system: In 
nstx_tuntap.c, the return value of write (for the tuntap file descriptor) is 
ignored, which means to ignore short writes or an EINTR.

Attached is a patch to fix this, would be excellent if you could include it.


-- System Information:
Debian Release: squeeze/sid
  APT prefers karmic-updates
  APT policy: (500, 'karmic-updates'), (500, 'karmic-security'), (500, 'karmic')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31-12-generic (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
#! /bin/sh /usr/share/dpatch/dpatch-run
## fix-return-values.dpatch by  <sistpoty@ubuntu.com>
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

diff -urNad nstx-1.1-beta6~/nstx_tuntap.c nstx-1.1-beta6/nstx_tuntap.c
--- nstx-1.1-beta6~/nstx_tuntap.c	2009-10-09 21:50:53.000000000 +0200
+++ nstx-1.1-beta6/nstx_tuntap.c	2009-10-09 21:53:01.000000000 +0200
@@ -266,7 +266,20 @@
 sendtun(const char *data, size_t len)
 //   printf("Sent len %d, csum %d\n", len, checksum(data, len));
-   write(tfd, data, len);
+	size_t count;
+	ssize_t ret;
+	for (count = 0; count < len; count += ret) {
+		ret = write(tfd, data + count, len - count);
+		if (ret < 0) {
+			if (errno == EINTR) {
+				continue;
+			}
+			return;
+		}
+	}

--- End Message ---
--- Begin Message ---
Version: 1.1-beta6-6+rm

nstx has been removed from Debian unstable: http://bugs.debian.org/595988

Closing its bugs with a Version higher than the last unstable upload.

More information about this script at:

--- End Message ---

Reply to: