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  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:	Fri, 21 Dec 2007 06:26:48 -0500
From:	Jeff Garzik <>
To:	YOSHIFUJI Hideaki / 吉藤英明 
Subject: Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()

YOSHIFUJI Hideaki / 吉藤英明 wrote:
> In article <> (at Fri, 21 Dec 2007 07:03:58 +0100), Eric Dumazet <> says:
>> Because tot_len is signed in tcp_v6_send_ack(), tot_len/4 forces compiler
>> to emit an integer divide, while we can help it to use a right shift,
>> less expensive.
> Are you really sure?
> At least, gcc-4.1.2-20061115 (debian) does not make any difference.

Quite true -- thus it is a matter of taste to the programmer.  Constant 
folding inside the compiler ensures that "foo / 4" asm output is just as 
optimal as a shift.

> And, IMHO, because shift for signed variable is fragile, so we should
> avoid using it.

I respectfully disagree, but this is an unrelated matter.  As you say, 
"/4" is fine as-is.


To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists