public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH 2/3] dhcp: Introduce support for Rapid Commit (option 80, RFC 4039)
Date: Mon, 25 Nov 2024 12:09:30 +1100	[thread overview]
Message-ID: <Z0POShmPmfmNVwmk@zatzit> (raw)
In-Reply-To: <20241125000423.4131458-3-sbrivio@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1239 bytes --]

On Mon, Nov 25, 2024 at 01:04:22AM +0100, Stefano Brivio wrote:
> I'm trying to speed up and simplify IP address acquisition in muvm.
> 
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  dhcp.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/dhcp.c b/dhcp.c
> index 2fe4a4d..aa0ad96 100644
> --- a/dhcp.c
> +++ b/dhcp.c
> @@ -342,8 +342,14 @@ int dhcp(const struct ctx *c, const struct pool *p)
>  	}
>  
>  	if (opts[53].c[0] == DHCPDISCOVER) {
> -		info("DHCP: offer to discover");
> -		opts[53].s[0] = DHCPOFFER;
> +		if (opts[80].clen == -1) {
> +			info("DHCP: offer to discover");
> +			opts[53].s[0] = DHCPOFFER;
> +		} else {
> +			info("DHCP: ack to discover (Rapid Commit)");
> +			opts[53].s[0] = DHCPACK;
> +			opts[80].slen = 0;
> +		}
>  	} else if (opts[53].c[0] == DHCPREQUEST || opts[53].clen <= 0) {
>  		info("%s: ack to request",
>  		     (opts[53].clen <= 0) ? "DHCP" : "BOOTP");

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-11-25  1:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-25  0:04 [PATCH 0/3] dhcp: Add support for Rapid Commit, broadcast replies Stefano Brivio
2024-11-25  0:04 ` [PATCH 1/3] dhcp: Use -1 as "missing option" length instead of 0 Stefano Brivio
2024-11-25  1:08   ` David Gibson
2024-11-25  8:30     ` Stefano Brivio
2024-11-25  9:18       ` David Gibson
2024-11-25  0:04 ` [PATCH 2/3] dhcp: Introduce support for Rapid Commit (option 80, RFC 4039) Stefano Brivio
2024-11-25  1:09   ` David Gibson [this message]
2024-11-25  0:04 ` [PATCH 3/3] dhcp: Honour broadcast flag (RFC 2131, 4.1) Stefano Brivio
2024-11-25  1:11   ` David Gibson
2024-11-25  8:30     ` Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z0POShmPmfmNVwmk@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).