Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 12:48:01 -0800 (PST) Received: from canuck.infradead.org (canuck.infradead.org [205.233.218.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SKltK6031695 for ; Fri, 28 Jan 2005 12:47:56 -0800 Received: from g133107.upc-g.chello.nl ([80.57.133.107] helo=172.31.3.43) by canuck.infradead.org with esmtpsa (Exim 4.43 #1 (Red Hat Linux)) id 1Cud1y-0006Fj-2H; Fri, 28 Jan 2005 15:47:51 -0500 Subject: Re: [PATCH] OpenBSD Networking-related randomization port From: Arjan van de Ven To: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= Cc: Stephen Hemminger , "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com, Hank Leininger In-Reply-To: <1106944492.3864.30.camel@localhost.localdomain> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> Content-Type: text/plain; charset=UTF-8 Date: Fri, 28 Jan 2005 21:47:45 +0100 Message-Id: <1106945266.7776.41.camel@laptopd505.fenrus.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by canuck.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 969 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: arjan@infradead.org Precedence: bulk X-list: netdev Content-Length: 1554 Lines: 59 On Fri, 2005-01-28 at 21:34 +0100, Lorenzo Hernández García-Hierro wrote: > Hi, > > Attached the new patch following Arjan's recommendations. > I'm sorry about not making it "inlined", but my mail agent messes up the > diffs if I do so. > Still waiting for the OSDL STP tests results, they will take a while to > finish. > > Cheers, lots better already! Some more comments (now that the patch got a lot easier to read :) static inline __u32 tcp_v4_init_sequence(struct sock *sk, struct sk_buff *skb) { - return secure_tcp_sequence_number(skb->nh.iph->daddr, - skb->nh.iph->saddr, - skb->h.th->dest, - skb->h.th->source); + + return ip_randomisn(); } is there a reason for the weird indentation? + if (!tp->write_seq) { + tp->write_seq = ip_randomisn(); + } spare { } pare that's not needed, also looks like one tab too many as for obsd_get_random_long().. would it be possible to use the get_random_int() function from the patches I posted the other day? They use the existing random.c infrastructure instead of making a copy... I still don't understand why you need a obsd_rand.c and can't use the normal random.c static inline u32 xprt_alloc_xid(struct rpc_xprt *xprt) { - return xprt->xid++; + /* Return randomized xprt->xid instead of prt->xid++ */ + return (u32) obsd_get_random_long(); + } that cast looks quite redundant...