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 D9F7C5A026F for ; Sat, 23 Sep 2023 09:45:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1695455108; bh=a5WG3+gWfCfTcMCOw+DCmqQFvhJQYViRySOVXQ48VMU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QxkjJ00oUpFu0Uyczpu9qOuxpt/Ls/Jkk3W9Z1Zr3gY+Bc2xL9jHWw4KFroKqacfc 8n+Nm9DXntcmuLJMRtCbGcAwV7jzYtGv/sQqzK2huEI7Um/D8wcUTBrmLlZwqwjXiP MLXMTDmhGd3weh2MTfPMw/qAzncAMmFdmtOCbxIs= Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Rt1Pw0LZmz4xQ2; Sat, 23 Sep 2023 17:45:08 +1000 (AEST) Date: Sat, 23 Sep 2023 17:42:51 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] dhcp: Actually note down the length of options received by the client Message-ID: References: <20230921165056.3761503-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="iK87aukYGdPuXumT" Content-Disposition: inline In-Reply-To: <20230921165056.3761503-1-sbrivio@redhat.com> Message-ID-Hash: 7WB2FQ7XTRQJIN4NZBAA4T4CIZ2ZU5ZR X-Message-ID-Hash: 7WB2FQ7XTRQJIN4NZBAA4T4CIZ2ZU5ZR 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, Stas Sergeev 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: --iK87aukYGdPuXumT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 21, 2023 at 06:50:56PM +0200, Stefano Brivio wrote: > It turns out we never used 'clen' until commit 1f24d3efb499 ("dhcp: > support BOOTP clients"), and we always ignored option 55 (Parameter > Request List), while, according to RFC 2132, we MUST try to insert > the requested options in the order requested by the client. >=20 > The commit mentioned above made this visible because now every client > is reported as sending a DHCPREQUEST as an old BOOTP client, based on > the lack of option 53 (that is, zero length). >=20 > Fixes: b439984641ed ("merd: ARP and DHCP handlers, connection tracking fi= xes") > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > dhcp.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/dhcp.c b/dhcp.c > index c1ac95e..46c258e 100644 > --- a/dhcp.c > +++ b/dhcp.c > @@ -317,6 +317,7 @@ int dhcp(const struct ctx *c, const struct pool *p) > return -1; > =20 > memcpy(&opts[*type].c, val, *olen); > + opts[*type].clen =3D *olen; > opt_off +=3D *olen + 2; > } > =20 --=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 --iK87aukYGdPuXumT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmUOluUACgkQzQJF27ox 2Gd9uQ//ddqx/rKxrmxR1pkG9hUvN6CV1sQtxYVx376qDhm3LI+lfEBabNzxun8g iwOSpnOI3jbAfgLoliRYB8KcLpQIwawEX3/IAUp1CsHiXuFZhF0bi6ZlirApeQy5 pB3XulaTe93pBNZcsFSX7P84AayDyN54voDOszAIUUIEYEs5DJXlEyUJQvZMBPZ/ irg5FXUnAUYdmTiq+nXA3DXXmZRwWjIfgvxhxUI7+sVx3GJm0gIxDpSLoApcyqo+ LMv9f5JidfkS0mCXRlvygABnRsqwR4bSHcUM5+JQ7pTsjDfpo112LBMPYfdsDq+i XUtQurbPLYqtwlN6X8K18hDoo5x9ZPBEpVKCDInuZDGO2/vU63j0MuQLR8lcKCWD rGGCNI3vz9/5AYOv87u2IT2hvHJga9+c0iAeObOJb3cAUHaJ/lznQSyY/Bdsz5PY JmNRgziUJl+hH/0HI+PnkmVohYxF8UaSTZTMuGr1Dr68wh3FNE1vpVhftr/iGWL7 eIaxCpn271zCJoFCMBNz+EdgyDZdeYk1APfgl51sTOpB1Mq8fMt4Z5/rv59A/Emy V9QR63FcEteq7Oyg0YOutp/OXeAZpIbJ3lmutmaKP27/v9dZ4rvvMWZmYlv/Yy9T +pPqxwuQT0dyGIf2MBxbPIxX1J7tqIxmXE0WX4mhoCYRKjmsAoQ= =Pdrf -----END PGP SIGNATURE----- --iK87aukYGdPuXumT--