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 Reviewed-by: David Gibson > --- > 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