From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harald Welte Subject: Re: [PATCH 2/2] [NETFILTER] remove bogus hand-coded htonll() Date: Sun, 4 Sep 2005 06:10:24 +0200 Message-ID: <20050904041024.GJ4415@rama.de.gnumonks.org> References: <20050903084315.GD4415@rama.de.gnumonks.org> <20050903165425.GZ7781@jm.kir.nu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+2GlJm56SCtLHYlr" Cc: David Miller , Netfilter Development Mailinglist , Linux Netdev List , linux-kernel@vger.kernel.org, bunk@stusta.de Return-path: To: Jouni Malinen Content-Disposition: inline In-Reply-To: <20050903165425.GZ7781@jm.kir.nu> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org --+2GlJm56SCtLHYlr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 03, 2005 at 09:54:25AM -0700, Jouni Malinen wrote: > On Sat, Sep 03, 2005 at 10:43:15AM +0200, Harald Welte wrote: >=20 > > htonll() is nothing else than cpu_to_be64(), so we'd rather call the > > latter. >=20 > Actually, the htonll() implementation does not seem to be doing what > cpu_to_be64() is doing.. However, I would assume this is a bug in > htonll() and this change to use cpu_to_be64() is fixing that.=20 ACK. > Can this bug cause any major problems in the current implementation? the "current implementation" was only merged after 2.6.13 is released, so I doubt anyone but the netfilter developers is using it yet. > I would assume that the first index should have had '-i' added to it, if > the purpose is to swap byte order.. The code here is leaving some > arbitrary data in 7 bytes of the 64-bit variable and setting > (u8*)&out[7] =3D (u8*)&in[7] in somewhat inefficient way ;-). In addition, > this looks more like swap-8-bytes-unconditionally than doing this based > on host byte order.. yes, yes, yes. Somehow this ancient buggy implementation slipped into mainline. I know I had fixed this before. So please let's all forget about this embarrassing htonll() and move on.=20 --=20 - Harald Welte http://netfilter.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie --+2GlJm56SCtLHYlr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFDGnOwXaXGVTD0i/8RAhJyAJwLxw7FtbHTtxZrFF8zkMhM9gleZQCfQqJJ aY1iTW76RK51YnVjV3RvhXs= =a4dJ -----END PGP SIGNATURE----- --+2GlJm56SCtLHYlr--