From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202502 header.b=XluZdQAE; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 74B965A0272 for ; Wed, 12 Feb 2025 02:14:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1739322874; bh=FpI+wOBuAfm8zWPZXoBWAMTK4Egx20t1d+MpER/qjfA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XluZdQAE4PU2qP63aYdnvt3j2DcFc6Vwm1D56Wvhr5aLVvS3s4KDC4OsfiWnHDFkf 6/mfLg4hxKEH/RZAC7mjxAUEUxH3/IO/D3XEdq69yD1sexJyi/WMtUrlnCq04DL8EK SAiMa9tgoLzDI9HvhQwwib8W8n6asjCj0Y8J+/XAXlvqVLp6RPMnDG8hDmdj/LcGnB +W32wdTOpmaavml8bxMuHZENXgSBsqfJ7BN7uD0waenxXBT//eP5UsYIfE0vLTUaOo smxUN1aHvlZ7rJZUjJHznv7cfO0T+6rt6iK9gTo/FziYwenXy2TkRv9rC3+odNkn8s xA2ZcuFhS41gA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Yt0hp4lVPz4wyk; Wed, 12 Feb 2025 12:14:34 +1100 (AEDT) Date: Wed, 12 Feb 2025 12:14:32 +1100 From: David Gibson To: Enrique Llorente Subject: Re: [PATCH] dhcp: Remove option 255 length byte Message-ID: References: <20250211111434.945152-1-ellorent@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5aGYVckwryboVryt" Content-Disposition: inline In-Reply-To: <20250211111434.945152-1-ellorent@redhat.com> Message-ID-Hash: EVBUV6HPDC42KR5FIEJMKWPQYPSK7GA7 X-Message-ID-Hash: EVBUV6HPDC42KR5FIEJMKWPQYPSK7GA7 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: --5aGYVckwryboVryt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 11, 2025 at 12:14:34PM +0100, Enrique Llorente wrote: > The option 255 (end of options) do not need the length byte, this change > remove that allowing to have one extra byte at other dynamic options. >=20 > Signed-off-by: Enrique Llorente Thanks, change is good. However, could you also update the comment on OPT_MAX's definition that appears to have the same error in it. > --- > dhcp.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/dhcp.c b/dhcp.c > index 401cb5b..3aef13f 100644 > --- a/dhcp.c > +++ b/dhcp.c > @@ -127,7 +127,7 @@ struct msg { > uint8_t sname[64]; > uint8_t file[128]; > uint32_t magic; > - uint8_t o[OPT_MAX + 2 /* End option and its length */ ]; > + uint8_t o[OPT_MAX + 1 /* End option */ ]; > } __attribute__((__packed__)); > =20 > /** > @@ -194,7 +194,6 @@ static int fill(struct msg *m) > } > =20 > m->o[offset++] =3D 255; > - m->o[offset++] =3D 0; > =20 > if (offset < OPT_MIN) { > memset(&m->o[offset], 0, OPT_MIN - offset); --=20 David Gibson (he or they) | 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 --5aGYVckwryboVryt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmer9fcACgkQzQJF27ox 2Ge7Yw//ZWKabyydfWJSYVf0kzYROLDF+FQk1fdCaqYvaM0LVuz5XBpdCvN6pMZ9 viGp3XFKK7wWIQaPBRua5DZgs8LA8y2wP0SMY/w87blLFtzFfHdL0AMfM1Cq7xjO HuNKft+kCOUJRbscqM2dYuxDelsi+J6haRI3ZHnxAq+lM841fKf7Ghp9K/RbF1JA hhSTZR/JBdDKTFO0aTye+YnlMPwObIO3R8SMdxGD0qGIURcsWX6aWEkLarWKIMiV SOYF2k0dEvB//yP1DNlFcuM+N2MkTSUNGSll9qlTosrLoBSG7ywtezCsjQueo10X rcbLUZtq+spAZNYvOEkZ4i/FSKvjgpfD5aaeeQzCfHBgX49W+wh0ot47gutDlRdF hqTzkSyRXTopMcL1ssTqekJ4M4Mx8ALPQ64wWb7TqUGGU9FIVV2OJRmZ4PnlYlEA 6+xBb8OzsnKJWpK3uCWJX+0Slt62qIHBNZzaZEmHNA0uXHetxMJDb2D2eWYj4CSd z5uQZDHA7hHrJOW48Dj0N6BuSAL6MZGAgQCi4JcBAUCt2I4WyExIWK1+dUn0REm6 CMPPaNTIJXhdeavM+7W6mTp7ZtzCA2O9gsLI27MaCTqUKAkR0/Bwy94n4zR10zVv V9ci0wqTacKyJfALg4MmQdMAsFDPcJWTzEwNQOoyr6zKekom82Y= =TQpY -----END PGP SIGNATURE----- --5aGYVckwryboVryt--