From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id A11405A061A; Tue, 26 Nov 2024 07:34:10 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH v4 0/3] dhcp: Add support for Rapid Commit, broadcast replies Date: Tue, 26 Nov 2024 07:34:07 +0100 Message-ID: <20241126063410.1950820-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: MBGFAZY5Q7LW2ZCH52BD2SD2DXVVGJ66 X-Message-ID-Hash: MBGFAZY5Q7LW2ZCH52BD2SD2DXVVGJ66 X-MailFrom: sbrivio@passt.top 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: David Gibson 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: These are all changes coming from pending muvm experiments where I'm trying to speed up and simplify the networking setup in the guest. v4: In 1/3, don't swap the "BOOTP" and "DHCP" labels: we want to print "BOOTP" if option 53 isn't there or has zero length, not the other way around. Further, check that clen for option 53 is > 0 before checking if it's a DHCPDISCOVER. Given that DHCPDISCOVER is 1 (not 0), this happened to already work for BOOTP, but it worked by mistake v3: In 1/3, set 'slen' for options we won't send to -1 in dhcp_init(), and reset it for option 80 every time we handle a DHCP request. Add a comment about DHCP needing a valid message type (option 53) v2: In 3/3, add in4addr_broadcast to ip.h, instead of open-coding it in dhcp() Stefano Brivio (3): dhcp: Use -1 as "missing option" length instead of 0 dhcp: Introduce support for Rapid Commit (option 80, RFC 4039) dhcp: Honour broadcast flag (RFC 2131, 4.1) dhcp.c | 53 +++++++++++++++++++++++++++++++++++++++++------------ ip.h | 3 +++ 2 files changed, 44 insertions(+), 12 deletions(-) -- 2.43.0