From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 4BCB35A026D for ; Thu, 6 Apr 2023 04:50:11 +0200 (CEST) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4PsQvz62XXz4xDr; Thu, 6 Apr 2023 12:50:07 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1680749407; bh=+1+L4boE+s31jAJBfLcmTPHVbJTFLRh6X42AFJwo3WI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L86hnNntuOCzR/HK0Ze6M4y89MiKY/GNZqk2QxpD1jQsiydzr5eE+1XDDQrTgxg3L MqleGDBcq+ZBfKM3o1UHsnUmIg0HWFO2gEGZF1c6bUQyjrY/ug3y1NmKmSOxXkwImM yrhojRZZikR+ar5VTJEVA2e/OmLaFvXAMrgIfpg0= Date: Thu, 6 Apr 2023 10:18:40 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 07/14] nstool: Add magic number to advertized information Message-ID: References: <20230404014638.3225556-1-david@gibson.dropbear.id.au> <20230404014638.3225556-8-david@gibson.dropbear.id.au> <20230405135834.0031231a@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8UpmvBR8gBJT4xuM" Content-Disposition: inline In-Reply-To: <20230405135834.0031231a@elisabeth> Message-ID-Hash: JOBUDM6VILS7M3DBBXMRGOXH6QWL5IPF X-Message-ID-Hash: JOBUDM6VILS7M3DBBXMRGOXH6QWL5IPF X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --8UpmvBR8gBJT4xuM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 05, 2023 at 01:58:34PM +0200, Stefano Brivio wrote: > On Tue, 4 Apr 2023 11:46:31 +1000 > David Gibson wrote: >=20 > > So that we'll probably give a better error if you point it at something > > that's not an nstool hold control socket. > >=20 > > Signed-off-by: David Gibson > > --- > > test/nstool.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > >=20 > > diff --git a/test/nstool.c b/test/nstool.c > > index 428c9c4..e995f3e 100644 > > --- a/test/nstool.c > > +++ b/test/nstool.c > > @@ -12,6 +12,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -45,7 +46,10 @@ const struct ns_type nstypes[] =3D { > > { CLONE_NEWUTS, "uts" }, > > }; > > =20 > > +#define NSTOOL_MAGIC 0x75601d75 > > + > > struct holder_info { > > + uint64_t magic; >=20 > Is uint64_t with just 32 bits "set" a trick to detect endianness > problems (perhaps it's a common pattern I'm not aware of)? Heh, no, that's just me having brainfade. I've extended the constant to 64-bits. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --8UpmvBR8gBJT4xuM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmQuD9oACgkQzQJF27ox 2Gc6pQ/+OYccCC/PXYjUz+I6oO2A36iIf6RaqkguBFZMWflUcggdiJ89kD74epZv EM30bFP8c0+onHBg/0WXqN7N9zHx9whH2QcRvKST4uytOBOuuBFmqJEJM/q4zPqo Wmk2JzlEVfag8MAV0A3bZXUugEMSeko7e+Sj2gTbmAPXqIVfABnskcwE9ihXQqPW iaCKWtuP3NvuUpKPfl9+l4jn9kwWHYkWOkdjISvYyKuefBd2b/MsLED2RPW3fTrO 6Roz6T7XJzBa/9o24SAXeJPkSKMY6VyvUdmIJQ8gzX0s6zWfm/QnBAzyhjYPrzSb hVvll2SXgDT1G+2wd/fVifJNxAGsrC7v/bIDam6V4luFpX+Jhn2n1M/C5tfb418p vknQuUHTGflfYpiw4h6wJ8DPblfAtACQGfbXyairW6cW2Vx9WzNwfuII5eFhq8gU vhxii7Lj1c+SVDGAzc2j03a0QiHCgXvKrNhwBlrmGqkwom4uTxl81S8B2T4jGFkt ph++8g1bDw84KcK3eG7mbe/gzUZhIDbX0wuqAE/OPohdfRH4OghkEJNrJvp784QL ICdNIHjpkMVKxbnOMutBHsSYtBarWWgvrGkOzzKlsn+OBBuhIm8nsAZZZntZYw7t PuWku5mOAllMnzFF+MZwVun1mtB5bCGxeb7djpvJKqsZIGAlhR0= =Gc0n -----END PGP SIGNATURE----- --8UpmvBR8gBJT4xuM--