lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 29 Jul 2008 08:16:52 -0500
From:	"J. K. Cliburn" <jcliburn@...il.com>
To:	Jarek Poplawski <jarkao2@...il.com>
CC:	netdev@...r.kernel.org, ian@...fray.co.uk
Subject: Re: sendfile() behavior while troubleshooting netdevice

Hi Jarek,

Jarek Poplawski wrote:
> sfclient.c:
> ...
> 		prev = count;
> 		count += ret;
> 		if (prev == count) {
> 			fprintf(stderr, "error: expected %d, received %d\n",
> 				fsize, count);
> --->			exit(1);
> 		}
> 
> Maybe you could try without this exit if anything comes later?

That's the way I initially had it, but I'd get infinite loops when the 
bytes were lost; no additional bytes ever showed up.  The 'if (prev == 
count)' check was added later, just to kick the thing out of that 
infinite loop.

However, your question made me realize that ret can be -1, and I don't 
want to change 'count' in that case.  Changed to

if (ret > 0)
	count += ret;

Thanks,
Jay
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists