From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YENU0-00064M-E9 for mharc-grub-devel@gnu.org; Thu, 22 Jan 2015 14:32:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YENTx-000647-Rk for grub-devel@gnu.org; Thu, 22 Jan 2015 14:31:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YENTw-0008Fb-IO for grub-devel@gnu.org; Thu, 22 Jan 2015 14:31:57 -0500 Received: from mail-we0-x22a.google.com ([2a00:1450:400c:c03::22a]:63726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YENTw-0008FX-Bf for grub-devel@gnu.org; Thu, 22 Jan 2015 14:31:56 -0500 Received: by mail-we0-f170.google.com with SMTP id x3so3706040wes.1 for ; Thu, 22 Jan 2015 11:31:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=BRvsGAYs5Dll+LDCNVEa0RuoqFSS3oTs43WV8XP5SgQ=; b=czzgBIIDToB+H1/pUlZloFEdtKZYMhq+ooiwZ0QRt1JE4jPQSHVEB0AKxVoWZqTQYQ 8X4ITaEUboaNoU733Ist7SwalN2noZA4O/v8XXrRYFpZtf9veA9p8AWeykuTBahPqgb8 YZeb0nMAOWBVGkHth61skNWz6KMyUaKoVQcRoY81+EXJFCNR5GinDKs6eWaUEfdlIcFr 1zwcoNeag51Yb8hECz088qcMPcrj+hlnATZi1uEDaWLHr5w3PsU8bdOyFV/zh8drKLMD oymgyquAhEiHwAa0rFIArINSrotg0MUn9RqpVSFaQbKPNIjAkozY1VIVzG2ceMY/8ZAa b1+A== X-Received: by 10.180.72.199 with SMTP id f7mr71628621wiv.53.1421955114846; Thu, 22 Jan 2015 11:31:54 -0800 (PST) Received: from ?IPv6:2620:0:105f:fd00:c6e9:2fff:fe57:96ed? ([2620:0:105f:fd00:c6e9:2fff:fe57:96ed]) by mx.google.com with ESMTPSA id w3sm5236845wjf.3.2015.01.22.11.31.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 11:31:54 -0800 (PST) Message-ID: <54C15029.6070803@gmail.com> Date: Thu, 22 Jan 2015 20:31:53 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: [PATCH] Allow nonstandard ports when specifying network protocols. (take 2) References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xSA275XHGRxcjil6FHWrfDJ7lI4ueaRgn" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::22a X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 19:31:58 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xSA275XHGRxcjil6FHWrfDJ7lI4ueaRgn Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > @@ -545,6 +545,7 @@ http_packets_pulled (struct grub_file *file) > static struct grub_net_app_protocol grub_http_protocol =3D > { > .name =3D "http", > + .port =3D HTTP_PORT, Wrong. This way you'll modify the default port for subsequent calls. Port should be passed as an additional argument to open. Use int and value -1 to indicate that no port is specified and change code to replace it by right port. Don't use 0 as 0 is a valid port. > + char *protname, *server; > + const char *work, *comma; > + grub_uint16_t port; > + grub_net_t ret; > + port =3D 0; > + work =3D name; > + server =3D NULL; > + protname =3D NULL; > + ret =3D NULL; > + > + /* Pick off the protocol first. */ > + comma =3D grub_strchr (work, ':'); > + if (!comma) > + comma =3D grub_strchr (work, ','); This makes colon equivalent to comma. We don't want another separator. "pxe:" is for compatibility. Leave it at that, don't add new functions to it. > + if (!comma) > { > - protname =3D "tftp"; > - protnamelen =3D sizeof ("tftp") - 1; > - server =3D grub_net_default_server; > + protname =3D grub_strdup(work); > + server =3D grub_strdup(grub_net_default_server); > } > else > { > - const char *comma; > - comma =3D grub_strchr (name, ','); > - if (comma) > - { > - protnamelen =3D comma - name; > - server =3D comma + 1; > - protname =3D name; > - } Please follow whitespace conventions (although it's minor concern). > + if (!grub_dl_load(protname)) > + { > + grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("disk `%s' not found"), > + name); > + goto out; > + } Please don't jumble unrelated changes. This has nothing to do with parser changes. The change you intend to make should be more like 20 lines of modified code, probably even less, not a jumbled case of many unrelated changes. --xSA275XHGRxcjil6FHWrfDJ7lI4ueaRgn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iF4EAREKAAYFAlTBUCkACgkQmBXlbbo5nOtBrwEAjI+4qjmZjjq9qkmUxG6PPRpC Z9cm469f1ePNPb9MINoBAI4Gn84iC1dtSbmwT3ppVBQxceAiidcTI0j2WvO+b/WS =TGHB -----END PGP SIGNATURE----- --xSA275XHGRxcjil6FHWrfDJ7lI4ueaRgn--