From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 8A0E05A026F for ; Thu, 7 Sep 2023 17:45:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694101531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6cQsrygWSliIGmT7A/MXqX3VVlRzsDrhAYeHVg/jp18=; b=T4QeV+53Kiyt9HsNgrKmZX/cnZ25sMciF76/fA68cBmPi8T4zKJWLQm8B4yo+1CHGA/lNS FXJPdUZMHI+SwOO8rNGiDvHKjVV0kNt+g5JKB8j04mOrNdrRGWg2EOYzqeSuOX35vqMCbr ry1zysNBJpvc7nO4ekGp0C17B4nLLyM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-8-Tl8ziKunOROGI77DEIbswg-1; Thu, 07 Sep 2023 11:45:29 -0400 X-MC-Unique: Tl8ziKunOROGI77DEIbswg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 766CD101CA85; Thu, 7 Sep 2023 15:45:29 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BDF951121318; Thu, 7 Sep 2023 15:45:28 +0000 (UTC) Date: Thu, 7 Sep 2023 17:45:26 +0200 From: Stefano Brivio To: Stas Sergeev Subject: Re: [PATCH] dhcp: support BOOTP clients Message-ID: <20230907174526.7c4a1e5b@elisabeth> In-Reply-To: <20230829091406.562224-1-stsp2@yandex.ru> References: <20230829091406.562224-1-stsp2@yandex.ru> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: SCEBXIKL4WJUBRVRIQ4AZX5LF4BR2T6P X-Message-ID-Hash: SCEBXIKL4WJUBRVRIQ4AZX5LF4BR2T6P X-MailFrom: sbrivio@redhat.com 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: On Tue, 29 Aug 2023 14:14:06 +0500 Stas Sergeev wrote: > BOOTP clients do not use tagged messages for requests. > As such, any message without the DHCP option 53, should be > considered a BOOTP request. > > Signed-off-by: Stas Sergeev > --- > dhcp.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/dhcp.c b/dhcp.c > index d04648c..c1ac95e 100644 > --- a/dhcp.c > +++ b/dhcp.c > @@ -323,8 +323,8 @@ 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; > - } else if (opts[53].c[0] == DHCPREQUEST) { > - info("DHCP: ack to request"); > + } else if (opts[53].c[0] == DHCPREQUEST || !opts[53].clen) { > + info("%s: ack to request", opts[53].clen ? "DHCP" : "BOOTP"); > opts[53].s[0] = DHCPACK; > } else { > return -1; Also applied. -- Stefano