From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akYpu-0005jY-Cp for qemu-devel@nongnu.org; Mon, 28 Mar 2016 11:12:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akYpq-0003Cl-2b for qemu-devel@nongnu.org; Mon, 28 Mar 2016 11:12:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akYpp-0003Cf-Sw for qemu-devel@nongnu.org; Mon, 28 Mar 2016 11:12:06 -0400 References: <1458862451-31703-1-git-send-email-samuel.thibault@ens-lyon.org> <1458862451-31703-3-git-send-email-samuel.thibault@ens-lyon.org> From: Eric Blake Message-ID: <56F949C4.3070302@redhat.com> Date: Mon, 28 Mar 2016 09:12:04 -0600 MIME-Version: 1.0 In-Reply-To: <1458862451-31703-3-git-send-email-samuel.thibault@ens-lyon.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="loRv19etOTMPA3uhV4cgHT7pBm9CmovLg" Subject: Re: [Qemu-devel] [PATCHv4 2/2] slirp: Allow disabling IPv4 or IPv6 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Samuel Thibault , qemu-devel@nongnu.org Cc: jan.kiszka@siemens.com, thuth@redhat.com, jasowang@redhat.com, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --loRv19etOTMPA3uhV4cgHT7pBm9CmovLg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/24/2016 05:34 PM, Samuel Thibault wrote: > Add ipv4 and ipv6 boolean options, so the user can setup IPv4-only and > IPv6-only network environments. >=20 > Signed-off-by: Samuel Thibault >=20 > --- >=20 > @@ -812,10 +822,18 @@ int net_init_slirp(const NetClientOptions *opts, = const char *name, > int ret; > const NetdevUserOptions *user; > const char **dnssearch; > + int ipv4 =3D 1, ipv6 =3D 1; These should be bool, and set to true. > =20 > assert(opts->type =3D=3D NET_CLIENT_OPTIONS_KIND_USER); > user =3D opts->u.user.data; > =20 > + if ((user->has_ipv6 && user->ipv6 && !user->has_ipv4) > + || (user->has_ipv4 && !user->ipv4)) > + ipv4 =3D 0; Inconsistent with current qemu style. Should be: if ((user->has_ipv6 && user->ipv6 && !user->has_ipv4) || (user->has_ipv4 && !user->ipv4)) { ipv4 =3D false; } In particular, the missing {} (should) fail ./scripts/checkpatch.pl. > + if ((user->has_ipv4 && user->ipv4 && !user->has_ipv6) > + || (user->has_ipv6 && !user->ipv6)) > + ipv6 =3D 0; More missing {} and unusual indentation. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --loRv19etOTMPA3uhV4cgHT7pBm9CmovLg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW+UnEAAoJEKeha0olJ0NqmMcH/3Iw8OpcNWXLSVuTRLuZeCNO MyBbGIe8a/lfbz0W3wmEy3iHtBc4YIt4EEUGzxXSuqs14eaz2ZDRQn2rX/Fu5yDf gmNZjWR70bm8UYScCSyfYvqlPEF6zJQE+//FNQir8GOzsCIhAXAW9XnFM5k+4vQU Oh/UyCy3C8Ln0lWhPHQNgr4F15SOlD86NMLtmtjv5mhN445Z3zK8YmrwDDbz4SdR ZdraK1IeUSKm4Opht9NzWthsmeHEtrIq2n5XcWSc3EY/hA/Mvwd6CsOi5GqPBRU+ fiXy/CtDWdlcUHRWLx6o7+zmp0kuMjvebbE8OXFTJQwiL56BqWUXNeako5eQB3g= =22dG -----END PGP SIGNATURE----- --loRv19etOTMPA3uhV4cgHT7pBm9CmovLg--