Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Apr 2001 12:10:19 -0700
From:      Kris Kennaway <kris@obsecurity.org>
To:        Wes Peters <wes@softweyr.com>
Cc:        Kris Kennaway <kris@obsecurity.org>, freebsd-security@FreeBSD.ORG, net@FreeBSD.ORG, provos@OpenBSD.org
Subject:   Re: non-random IP IDs
Message-ID:  <20010416121019.D10023@xor.obsecurity.org>
In-Reply-To: <3ADB0389.5D236D88@softweyr.com>; from wes@softweyr.com on Mon, Apr 16, 2001 at 08:36:57AM -0600
References:  <001f01c0c30b$805b0840$d2e2fdce@netrex.com> <Pine.BSF.4.31.0104120035120.2153-100000@achilles.silby.com> <20010416020311.A1292@xor.obsecurity.org> <3ADB0389.5D236D88@softweyr.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010416121019.D10023>