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=Em2gsl4i; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id B60375A0623 for ; Tue, 18 Feb 2025 03:07:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1739844441; bh=X0EJV5VUbsg12zoE2CwOx5ZwF39L+nsgS8PqIslhDDc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Em2gsl4iXHhkTYXeoKxaNO/YbC8jKzn6zvIcC3973FilZDVKrRM/ojUWBSUVp3lZB a5Gh0G6zul1XRaJJn2jwRgGZJeMPuSlQnRiNxNQFqtLHGycXLDOTntWUJWapw5JZis y8IN5uxk/tAGtVGfo7lVpWBstWcee+WtArK5VbC+uADojKLCLTQL1+NAr93FOxSilp WKTfuOdekHne74EVxJtNaWFL1a7nHlKnyBcKij4K+1w0k1WSh5zZbS3b4wTvAji4vi rCh5l3GdZE0WkhzLSMCR1nvw6K75vxghEqijyOUwigmRVy4XXgeAxlZN1DUzqcjsuR fNzXB9c7wEvBA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4YxjZx6mgVz4wyw; Tue, 18 Feb 2025 13:07:21 +1100 (AEDT) Date: Tue, 18 Feb 2025 12:26:39 +1100 From: David Gibson To: Enrique Llorente Subject: Re: [PATCH v2] dhcp: Remove option 255 length byte Message-ID: References: <20250217092814.424375-1-ellorent@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MlnYiq3+A/Hs9NJF" Content-Disposition: inline In-Reply-To: <20250217092814.424375-1-ellorent@redhat.com> Message-ID-Hash: 7EKGA2PLDLTPUNFKTSOJPSQVS4A2VN6Q X-Message-ID-Hash: 7EKGA2PLDLTPUNFKTSOJPSQVS4A2VN6Q 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: --MlnYiq3+A/Hs9NJF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 17, 2025 at 10:28:14AM +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 Reviewed-by: David Gibson > --- > dhcp.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) >=20 > diff --git a/dhcp.c b/dhcp.c > index 401cb5b..4a209f1 100644 > --- a/dhcp.c > +++ b/dhcp.c > @@ -64,9 +64,9 @@ static struct opt opts[255]; > #define OPT_MIN 60 /* RFC 951 */ > =20 > /* Total option size (excluding end option) is 576 (RFC 2131), minus > - * offset of options (268), minus end option and its length (2). > + * offset of options (268), minus end option (1). > */ > -#define OPT_MAX 306 > +#define OPT_MAX 307 > =20 > /** > * dhcp_init() - Initialise DHCP options > @@ -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 --MlnYiq3+A/Hs9NJF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmez4ccACgkQzQJF27ox 2GeUBQ//Uo7pcaebecYKHBsil5McWml1XlM5jaTEy/38SZWE+bXGqJ46nzld0jGZ VtlGgHzzcNvu43GNK9DqoRCymW+aRocpfcbSiBgoyGLVep8maQ8fcFyHePgX5DNU P103+ZxHqy1jin8eRtV2k5kNmaDUYgBZ8HyRwROn6PEv1PY+YhEfnCEjpDBCLjxu A7BaYAuUVbtjoqQPNtrUF0Uz6y1YEW/8zZNVYb5ADn9SzhpZjXaA8PdObenulTaj 5DEJBM7fX07sX8nwPL4yYnhFaLDaizPcj89mR5GOb1RK7JPVwvYHMZGnzF3ne/ux OvOF0HTm9zswDMQQ2fm8RviCJi+LVbtFr9UJaBgIfoJDLVBr8ldC9GPJE+jSqE3p Do+1Sg55Au3JT7xTc+z7rssPCXcYeJ96xbAmA6h/lznyPTSNBOW9jKY8ikxiADXn KbDi0cv5pqxBbLThysO/mGFJgdQYo4DGjF0+ZHcuUiI5WMoghjgJb9mXzuDGsOkF P5LdK5+KFS/s6Gn/XNYM+ZojUezbmylKDzzUQnWM2PYN7iKHQwTIe6KrOSkmB16Z tg4myl3K/7cwlEdkCvHsCaf2TMQBlXF+qeKXqweAwicgWilzEAzG3UnOmyVQepqx cgVVntoXbf2Yf9WDElHeRyOCTQ0iWAoyZMVWW3sYX8OcbRK5BL4= =afEA -----END PGP SIGNATURE----- --MlnYiq3+A/Hs9NJF--