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]
Message-ID: <Pine.LNX.4.64.0812052349380.3726@wrl-59.cs.helsinki.fi>
Date:	Fri, 5 Dec 2008 23:53:41 +0200 (EET)
From:	"Ilpo Järvinen" <ilpo.jarvinen@...sinki.fi>
To:	Ben Hutchings <bhutchings@...arflare.com>
cc:	David Miller <davem@...emloft.net>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH] dccp: use roundup instead of opencoding

On Fri, 5 Dec 2008, Ben Hutchings wrote:

> On Fri, 2008-12-05 at 23:43 +0200, Ilpo Järvinen wrote:
> > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...sinki.fi>
> > ---
> >  net/dccp/output.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/net/dccp/output.c b/net/dccp/output.c
> > index fea30cd..1b75ece 100644
> > --- a/net/dccp/output.c
> > +++ b/net/dccp/output.c
> > @@ -175,7 +175,7 @@ unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu)
> >  	 * make it a multiple of 4
> >  	 */
> >  
> > -	cur_mps -= ((5 + 6 + 10 + 6 + 6 + 6 + 3) / 4) * 4;
> > +	cur_mps -= roundup(5 + 6 + 10 + 6 + 6 + 6);
> 
> Maybe you should check that with your compiler.

Ah, sorry, I thought I'd made plenty of builds but sadly dccp wasn't 
included in any of them... Thanks for the alert. Added the missing , 4 
below.

-- 
 i.

[PATCH] dccp: use roundup instead of opencoding

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...sinki.fi>
---
 net/dccp/output.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/dccp/output.c b/net/dccp/output.c
index fea30cd..1b75ece 100644
--- a/net/dccp/output.c
+++ b/net/dccp/output.c
@@ -175,7 +175,7 @@ unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu)
 	 * make it a multiple of 4
 	 */
 
-	cur_mps -= ((5 + 6 + 10 + 6 + 6 + 6 + 3) / 4) * 4;
+	cur_mps -= roundup(5 + 6 + 10 + 6 + 6 + 6, 4);
 
 	/* And store cached results */
 	icsk->icsk_pmtu_cookie = pmtu;
-- 
1.5.2.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ