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=JGbAwBXh; 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 897165A0265 for ; Wed, 01 Jul 2026 19:00:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782925204; 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=+XaobJmoA5tSMinrB/TkIJrGa5u20UfDsnyuMiQDza4=; b=JGbAwBXhNYK27HFvKv4lO74P3BY2bQfj76ynk+XtEHHPvbPqljmVCtib6wfvmWTulYQ9Jt CO+y723t1DiI3zgO9UiMmy0+OGfmb+8KSpvUh9e0cqRJFtZ2qoCay8OViIl4Cj7Ot9wEym 8HrwBPQOAc0AFQpuvP/mnI0E91AknTY= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-618-JKSvEIDmOp6xhF8P8AWhxg-1; Wed, 01 Jul 2026 13:00:01 -0400 X-MC-Unique: JKSvEIDmOp6xhF8P8AWhxg-1 X-Mimecast-MFC-AGG-ID: JKSvEIDmOp6xhF8P8AWhxg_1782925200 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-493bab443f7so9838315e9.0 for ; Wed, 01 Jul 2026 10:00:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782925200; x=1783530000; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+XaobJmoA5tSMinrB/TkIJrGa5u20UfDsnyuMiQDza4=; b=hBosuioyHGSTaj3dAXYroyEN4WVSfJIKZcjeGBFFGC3NIMV6g6kAk0gOGWbncNLh+n zunprDeGLfc6pgXepw3OoFhFqlAbGu5OwTO/Gu2p6PrikxPWPKPtJSIvU2zjXmVriXHI 53TRZrXubNitZLgpkOH1cODwFTBtatXgeVY0e+YX7/ZqEdeijHR1Ec4It48PLb/UnYxg SC7q+sDb2P3pvRGgibOiBhk38ehnzCeyYZrKtQNUfgnkf93IAd9VE7UiYCKyXMEoc5Kw 0uMdqn3JUC67hxk+KefHI2jUhTnAdInpwxFtIha9JzR8uQNfJ2kp/ppjCqYNV7NJK7YL ogZA== X-Gm-Message-State: AOJu0Yw0nU3k1Tv0KehZILth9uDjFwKcssqIsziATKARrwI2F6MBx1gS IWCdpGd1WZ9oXfHTLRUMmYLl6RbwFOy9cBcpTjNNQbDWUKtFJHc9kG6KyFkaC31PEERN6cHRf5o LHIcCIBlke3uMa2leP8qd5n/M4aqO7zPyTLGU+n5yD71z7/2qmZE6djYMsV/OVg== X-Gm-Gg: AfdE7cnLYf+0khEPnEDvWjntD99NicoY2/FR0MI1YztmcA1gLwPBFvLaqIQ7T7bR5uv NJu9Yclm4CWtGkzh39lmdKxqMp4zEVc7Tiqa8KCJRjQPdMGZrUid85LB4nmYSt+uTczkrHqzrBJ DEEA40c3Gn0Ie1ZyinPNf9QyuVcCbPg2Xj0dEOmaVnRBCBokfo6VJmZo0V2AI827WILXG3NbJxF 51OrRDgUFjl6Dw9gCHeVqeMDpCbD9x/5hfgbhon/ksNNd6swNz7mj+oQavcPAhJlTobidjsZ9IZ kRICTjRw0OkSGk4V8KNtu781y3aqIyqZvo/sWZ//wAnAno/ceLDkTSXBjf2Rre5cyN2RE6hxmJT AApL/2JPl+1vPeXJO1s+BnA== X-Received: by 2002:a05:600c:c0c3:20b0:492:2fc8:21f2 with SMTP id 5b1f17b1804b1-493bc22e7b1mr76825255e9.8.1782925200241; Wed, 01 Jul 2026 10:00:00 -0700 (PDT) X-Received: by 2002:a05:600c:c0c3:20b0:492:2fc8:21f2 with SMTP id 5b1f17b1804b1-493bc22e7b1mr76824915e9.8.1782925199715; Wed, 01 Jul 2026 09:59:59 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-477db8a4ad4sm1468751f8f.11.2026.07.01.09.59.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2026 09:59:59 -0700 (PDT) From: Stefano Brivio To: Anshu Kumari Subject: Re: [PATCH v2 2/2] dhcpv6: Inject custom options into DHCPv6 replies Message-ID: <20260701185958.334f1add@elisabeth> In-Reply-To: <20260618120529.1768765-3-anskuma@redhat.com> References: <20260618120529.1768765-1-anskuma@redhat.com> <20260618120529.1768765-3-anskuma@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Wed, 01 Jul 2026 18:59:58 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: WfFLRIYTVgVFvlHslZb1hJK7p5-xW2EHpNbloTC_nXk_1782925200 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 4SOUXKMHRGCQFZ7TRG3767THV6AVYYAO X-Message-ID-Hash: 4SOUXKMHRGCQFZ7TRG3767THV6AVYYAO 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, david@gibson.dropbear.id.au, lvivier@redhat.com, jmaloy@redhat.com 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 Thu, 18 Jun 2026 17:35:29 +0530 Anshu Kumari wrote: > Append user-specified options from --dhcpv6-opt to DHCPv6 reply > messages. Options are parsed from the stored string value at reply > time using dhcpv6_opt_parse(), and skipped with a debug message if > they exceed the available space. > > Link: https://bugs.passt.top/show_bug.cgi?id=192 > Signed-off-by: Anshu Kumari > --- > v2: > - Updated dhcpv6_custom_opts_fill() to parse str at reply time > using dhcpv6_opt_parse() instead of copying cached val/len. > --- > dhcpv6.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > > diff --git a/dhcpv6.c b/dhcpv6.c > index 1e1dd0d..6b1e90b 100644 > --- a/dhcpv6.c > +++ b/dhcpv6.c > @@ -748,6 +748,49 @@ static size_t dhcpv6_client_fqdn_fill(const struct iov_tail *data, > return offset + sizeof(struct opt_hdr) + opt_len; > } > > +/** > + * dhcpv6_custom_opts_fill() - Append user-specified custom options to reply > + * @c: Execution context > + * @buf: Response message buffer > + * @offset: Current offset in buffer > + * > + * Return: updated offset after appending custom options > + */ > +static size_t dhcpv6_custom_opts_fill(const struct ctx *c, > + char *buf, int offset) > +{ > + int i; > + > + for (i = 0; i < c->dhcpv6_opts_count; i++) { > + uint16_t code = c->dhcpv6_opts[i].code; > + struct opt_hdr *hdr; > + uint8_t val[255]; This should be UINT16_MAX. Other than that, this looks good to me, except for pending comments from David and also my considerations on top of that. -- Stefano