From owner-freebsd-security Mon Apr 16 12:10:27 2001 Delivered-To: freebsd-security@freebsd.org Received: from obsecurity.dyndns.org (adsl-63-207-60-27.dsl.lsan03.pacbell.net [63.207.60.27]) by hub.freebsd.org (Postfix) with ESMTP id BB9E737B42C; Mon, 16 Apr 2001 12:10:20 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id C7B1B66D8B; Mon, 16 Apr 2001 12:10:19 -0700 (PDT) Date: Mon, 16 Apr 2001 12:10:19 -0700 From: Kris Kennaway To: Wes Peters Cc: Kris Kennaway , freebsd-security@FreeBSD.ORG, net@FreeBSD.ORG, provos@OpenBSD.org Subject: Re: non-random IP IDs Message-ID: <20010416121019.D10023@xor.obsecurity.org> References: <001f01c0c30b$805b0840$d2e2fdce@netrex.com> <20010416020311.A1292@xor.obsecurity.org> <3ADB0389.5D236D88@softweyr.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="zbGR4y+acU1DwHSi" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3ADB0389.5D236D88@softweyr.com>; from wes@softweyr.com on Mon, Apr 16, 2001 at 08:36:57AM -0600 Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --zbGR4y+acU1DwHSi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Apr 16, 2001 at 08:36:57AM -0600, Wes Peters wrote: > Looks clean. The only comment I can find is: Why not have ip_randomid() > return the ID in network byte order? It would save several HTONS macros > trailing the ip_randomid() calls. I can't think of anything off the top of my head, but there was some reason why OpenBSD made this change: diff -u -r1.12 -r1.13 --- ip_mroute.c 1999/01/08 01:04:17 1.12 +++ ip_mroute.c 1999/01/08 21:51:22 1.13 @@ -1397,7 +1397,8 @@ */ ip_copy = mtod(mb_copy, struct ip *); *ip_copy = multicast_encap_iphdr; - ip_copy->ip_id = htons(ip_randomid()); + ip_copy->ip_id = ip_randomid(); + HTONS(ip_copy->ip_id); ip_copy->ip_len = len; ip_copy->ip_src = vifp->v_lcl_addr; ip_copy->ip_dst = vifp->v_rmt_addr; Presumably there was some reasoning there. Niels, can you shed any light? Kris --zbGR4y+acU1DwHSi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE620ObWry0BWjoQKURAuUHAKCdHQSfWDRrszsnqghfWJ7GduljdwCgrCzh VXHsMlwwU2Z8rsVXQhbiVlo= =beZj -----END PGP SIGNATURE----- --zbGR4y+acU1DwHSi-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message