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=LG7DT0ds; 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 190CA5A0281 for ; Mon, 26 May 2025 16:20:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748269254; 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=AdgPlJKDUmD6Yc8jCLZ1wv1Xn4TDpStUbhJ08pRUnnE=; b=LG7DT0ds8eZ2awQlQ5vrB4e5RJhyK2ovl13lbGoajFd77tBO3LgI1+M/IujT40U80mKxg+ c52RUl1RTvY3VtZyw2kTjnS3JskzQ+fadqhxxFhR59I9SNz8vadLhG8DQSU/NL+0Y/iveG NU8M9rbHXwf60jOSTcIhjDvMISLMxD4= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-282-S3KUEqNJNGe2gETYVxiaQQ-1; Mon, 26 May 2025 10:20:52 -0400 X-MC-Unique: S3KUEqNJNGe2gETYVxiaQQ-1 X-Mimecast-MFC-AGG-ID: S3KUEqNJNGe2gETYVxiaQQ_1748269251 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-43ce8f82e66so12443495e9.3 for ; Mon, 26 May 2025 07:20:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748269251; x=1748874051; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=AdgPlJKDUmD6Yc8jCLZ1wv1Xn4TDpStUbhJ08pRUnnE=; b=YH48ppUUIjkBhYhF97KXNsecOC7/dkkUQYvCq9KxcbivK8821Vx6IaWy+duQfHIvkh EXpMWps9EY247SVR07VBRWzDCnN4my4JzLPuz1FkqWndzJs6ndmvOAvRjFH8BEAX3Ufw dobRNtye4JLZcNJP+rTqE5m+YdFaodnTTxL0AE0RoV9mNg69YpFs4V+1M2VGzGo0NvOs QNkjNY+r/wvx90LUQmivBQRny3Qpmvy/zH56s7QoWVTGcJ1HNqKSOamm2+3H58QInL2y GGeUfLOnhSJTr6qB7lWNfAhbCBcdVGkVJVY+PRrT9juIm8qB6FNTzEPjcZZyeixBXC7P Ek5w== X-Gm-Message-State: AOJu0YyHOzKYWym83yiV9Cq+GFuaJzPpqM6J5dKxUnxT5ryyNyQ2nyiA dqONKn7Py4tjRbjoIFHRwSkL1wSJgpQPr1uMcuhS/EmJxmi49lw5e4iUHVEN14WdWMpAZUB9Go8 s8KM0CdYRV+NSjNDxYObLXaDtLiUPtmGCk+7r6wAW6dzpCq7V2ohY8zai27wiiw2VE1nBEtARFN RFkJwu9zoqhXC2B0p/iYj8EQQsXZ2mC6Px593m X-Gm-Gg: ASbGnctYiXG3ZfraKm4p44IQTDGvNrOAKRtwHkUEiNcqW3Yrt5/zia7KjXH6A2Vhtze GlJmiycWgNtJtn08EZJooILKiLumQtrfduo/GABGPH9un9F3enN9caK2brE7pg5HfDcoSP7IgJT +1S1d0V7zYMFJkqlglofva+590mPZD8my4NRF7mwm7GKYKrx0K9UN2FOF3AVPl8DHnfHe7N3jm/ rQlyRkkJ+DXKN5Cfxf2DDCSNfX94PwB0WSHZV3yWAwWb/66HwAacydktjAfB6v5sYMDP8MW51No SJF9nUdirOEYa8bMj5zCCks= X-Received: by 2002:a05:600c:4618:b0:43c:fd72:f028 with SMTP id 5b1f17b1804b1-44d5bb9360fmr38389795e9.29.1748269251018; Mon, 26 May 2025 07:20:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7e9J376W3abOn718jyq34pFpJnbCoCAv/j0wmr75u54+qERFgYuhiidf3F2/tVAG4MwERnA== X-Received: by 2002:a05:600c:4618:b0:43c:fd72:f028 with SMTP id 5b1f17b1804b1-44d5bb9360fmr38389565e9.29.1748269250496; Mon, 26 May 2025 07:20:50 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-448ba3d8facsm222636185e9.6.2025.05.26.07.20.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 May 2025 07:20:50 -0700 (PDT) Date: Mon, 26 May 2025 16:20:49 +0200 From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH v5 17/29] dhcp: Convert to iov_tail Message-ID: <20250526162049.298291b9@elisabeth> In-Reply-To: <20250417165136.2688884-18-lvivier@redhat.com> References: <20250417165136.2688884-1-lvivier@redhat.com> <20250417165136.2688884-18-lvivier@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 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 5cmt03DCRw19QimA1fqsghSjZ5sVYJbYUI4j_hLEP3Q_1748269251 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: PXWENNTTYUAVFWMT6WLRSGVZX7N4G3SS X-Message-ID-Hash: PXWENNTTYUAVFWMT6WLRSGVZX7N4G3SS 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 Thu, 17 Apr 2025 18:51:24 +0200 Laurent Vivier wrote: > Use packet_data() and extract headers using IOV_REMOVE_HEADER() > and IOV_PEEK_HEADER() rather than packet_get(). > > Signed-off-by: Laurent Vivier > --- > dhcp.c | 45 +++++++++++++++++++++++++++------------------ > 1 file changed, 27 insertions(+), 18 deletions(-) > > diff --git a/dhcp.c b/dhcp.c > index b0de04be6f27..e8408ef04839 100644 > --- a/dhcp.c > +++ b/dhcp.c > @@ -302,27 +302,33 @@ static void opt_set_dns_search(const struct ctx *c, size_t max_len) > */ > int dhcp(const struct ctx *c, const struct pool *p) > { > - size_t mlen, dlen, offset = 0, opt_len, opt_off = 0; > + size_t mlen, dlen, opt_len; > char macstr[ETH_ADDRSTRLEN]; > struct in_addr mask, dst; > const struct ethhdr *eh; > const struct iphdr *iph; > const struct udphdr *uh; > + struct iov_tail data; > struct msg const *m; > + struct msg mc; > + struct ethhdr ehc; > + struct iphdr iphc; > + struct udphdr uhc; Nit: these should be ordered from longest to shortest. Usual observation about the 'c' in 'mc' etc. -- Stefano