From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CTyNYVRE; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 7A2485A0265 for ; Mon, 18 May 2026 15:20:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779110421; 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=H6JgC1QRTV/WlYPEha6dKFSEIebz5UufWOoDuYrndKE=; b=CTyNYVRE6c7bSQ8f50lBCoSuWl64WywynJj8LPh4MXlBVkSmjiYXeYCdxcX0zTFybSh8gk MeMLmF0RZozS/3YXS7ch2pQmj3R8CAg1ASqwLDYKtE3Gfn/7YdUusn8Z2HNEvgjEU4Wty8 CYnA3H1B7GKnHpxQ0HoWmXDMCaHHMNE= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-246-oURkNEUiN_O-6icG6Ko-mA-1; Mon, 18 May 2026 09:20:17 -0400 X-MC-Unique: oURkNEUiN_O-6icG6Ko-mA-1 X-Mimecast-MFC-AGG-ID: oURkNEUiN_O-6icG6Ko-mA_1779110416 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EA25618002DD; Mon, 18 May 2026 13:20:15 +0000 (UTC) Received: from anskuma-thinkpadp1gen7.bengluru.csb (unknown [10.74.80.120]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E68F618004A3; Mon, 18 May 2026 13:20:12 +0000 (UTC) From: Anshu Kumari To: anskuma@redhat.com, sbrivio@redhat.com, passt-dev@passt.top Subject: [PATCH 2/6] conf: Add --dhcp-boot command-line option Date: Mon, 18 May 2026 18:49:58 +0530 Message-ID: <20260518132002.418296-3-anskuma@redhat.com> In-Reply-To: <20260518132002.418296-2-anskuma@redhat.com> References: <20260518132002.418296-1-anskuma@redhat.com> <20260518132002.418296-2-anskuma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: YC46qKviTFfeHSxSxyDq2RjlQX6omrEcOpLF0-Xow8w_1779110416 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: QREIHRO7AWMR44EAARPG25GEUMMEHMWN X-Message-ID-Hash: QREIHRO7AWMR44EAARPG25GEUMMEHMWN X-MailFrom: anskuma@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: lvivier@redhat.com, jmaloy@redhat.com, david@gibson.dropbear.id.au 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: Introduce the --dhcp-boot flag that sets the boot file URL for network boot specially for ipxe. This patch adds the option storage and CLI parsing. Link: https://bugs.passt.top/show_bug.cgi?id=192 Signed-off-by: Anshu Kumari --- conf.c | 9 +++++++++ passt.h | 1 + 2 files changed, 10 insertions(+) diff --git a/conf.c b/conf.c index 2624e58..61a393f 100644 --- a/conf.c +++ b/conf.c @@ -618,6 +618,7 @@ static void usage(const char *name, FILE *f, int status) " a single, empty option disables the DNS search list\n" " -H, --hostname NAME Hostname to configure client with\n" " --fqdn NAME FQDN to configure client with\n" + " --dhcp-boot URL Boot file URL for network boot\n" " --dhcp-opt CODE,VAL Set DHCP option by code\n"); if (strstr(name, "pasta")) FPRINTF(f, " default: don't use any search list\n"); @@ -846,6 +847,8 @@ static void conf_print(const struct ctx *c) info(" router: %s", inet_ntop(AF_INET, &c->ip4.guest_gw, buf, sizeof(buf))); + if (c->dhcp_boot[0]) + info(" boot file: %s", c->dhcp_boot); for (i = 0; i < c->custom_opts_count; i++) info(" option %u: %s", c->custom_opts[i].code, @@ -1239,6 +1242,7 @@ void conf(struct ctx *c, int argc, char **argv) {"migrate-no-linger", no_argument, NULL, 30 }, {"stats", required_argument, NULL, 31 }, {"conf-path", required_argument, NULL, 'c' }, + {"dhcp-boot", required_argument, NULL, 32 }, {"dhcp-opt", required_argument, NULL, 33 }, { 0 }, }; @@ -1472,6 +1476,11 @@ void conf(struct ctx *c, int argc, char **argv) die("Can't display statistics if not running in foreground"); c->stats = strtol(optarg, NULL, 0); break; + case 32: + if (snprintf_check(c->dhcp_boot, sizeof(c->dhcp_boot), + "%s", optarg)) + die("Boot file name too long: %s", optarg); + break; case 33: { unsigned long code; const char *comma; diff --git a/passt.h b/passt.h index acb57dd..2354a0f 100644 --- a/passt.h +++ b/passt.h @@ -262,6 +262,7 @@ struct ctx { char hostname[PASST_MAXDNAME]; char fqdn[PASST_MAXDNAME]; + char dhcp_boot[PATH_MAX]; #define MAX_CUSTOM_DHCP_OPTS 32 -- 2.54.0