From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none 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=A4Yh/fQK; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id A13025A004E for ; Mon, 10 Feb 2025 19:15:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739211353; 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=BfGHlyKs/An0J0DKGVQ6ZUxDfdTTdPZlitRcyWGBRPA=; b=A4Yh/fQK7WDmcAH+MhE8ANir+R1/MXYPRU56Vth7T/RgU7uElFzbBtLS8nVik3g0SUGYGP o8JPw4BMTC4kPOCN+5vXi97beuVIoGOjj/lH1Rv5nVw5fOQAQ+zmMsxgGbu2l/zdBIwjs0 yBSzT2otkREc9U1ztzglUrbYe228cTw= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-125-K40baf1ENwGmHLNJJVoGyg-1; Mon, 10 Feb 2025 13:15:51 -0500 X-MC-Unique: K40baf1ENwGmHLNJJVoGyg-1 X-Mimecast-MFC-AGG-ID: K40baf1ENwGmHLNJJVoGyg Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-38de0201875so580378f8f.0 for ; Mon, 10 Feb 2025 10:15:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739211350; x=1739816150; 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=BfGHlyKs/An0J0DKGVQ6ZUxDfdTTdPZlitRcyWGBRPA=; b=fslAXjBuypXy5DqMZE3nuBmpY5Xv6uIN0FsTofq5ELV3teSJJNyUDo6rvE5/809kmQ khwOUSQrRqspjpQ4UO4s83//ncUgIhFw+Mr0uoX0asQCVb0Upwcwqgy5VU+V8Bm2AUv1 B3xpfG1OsK/2OCeBatFWe8ub/SN6URutr8KS1tP38ppnGoj5goIYCsGRLe4bxr87L/VX qXNMsZLqQfSks1+/fiLmQ3wTymO1i8rGY7LYwkiQXpdGE1JEiY/QHkSGCqkI1r/sjwF2 8Zy+Uxh5XhCtEFHMzcgN7zIGFk/9IWq4yZ0iu8jseiBkDnBzKLnsR3zpHVHJDGfOV3QQ ZExA== X-Gm-Message-State: AOJu0Yw3T1XhgzM6XKyf9k21NTCe4gloeP66cBEstGFYxib5xYjMFAzG vmYLPImgei4wSyg0hibbsPiuZICRgwzjX+b7q+yX+7ELCEhVOIpeS2EwI7g3rQr6TX3RuZkRTGt J01yDiayx8ELEoCh+zZWCr9Mdn06e7T3ZTxOmLn8sf4mS6FA1W0T78i5xXP1zps90wqUFCPj7hd Mk+ys9e8xEDTha5e+Jn4Q04JfwoUk2Jdz/ X-Gm-Gg: ASbGnct2N33BQTxwO/DkgxpM6GjtdTdkqnB+xuEQZZI6WnQFkezJ4CLajVCN1fFr6nw 1fYyTFhZbwKz8T/Wv3JQbBH2SqaAXyzG53jP1GS4OE3jsCZlMK1qSCN4U8bnbQtWB9ZbbVMsofA OXJLCZ66Db35uaWyk5rQxnhuQGab5P16nFPCnUZsa93nT5LW499mHyiJHl2gDL9hopWeN5Jduaq AkAemkvcMxF3Aytv/IyWq4EKPUBaqqaZvxPJX5TBQDoX5jkATEgdjhLQby3zrD6qu59ckokmLSv 41D0mhYsLUIS1551Ji6KJRr5DDxbqRn7mw== X-Received: by 2002:a5d:6d0b:0:b0:38d:e412:adb0 with SMTP id ffacd0b85a97d-38de412adbamr651633f8f.3.1739211350019; Mon, 10 Feb 2025 10:15:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8vpHQ3XsB/54ZtaQmieeCHz1djiGc6Ylf9eaF9XDRk7160281lLJRuvhPKVpSGj3sL0kPDQ== X-Received: by 2002:a5d:6d0b:0:b0:38d:e412:adb0 with SMTP id ffacd0b85a97d-38de412adbamr651605f8f.3.1739211349629; Mon, 10 Feb 2025 10:15:49 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dc6c80df2sm11190419f8f.18.2025.02.10.10.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2025 10:15:48 -0800 (PST) Date: Mon, 10 Feb 2025 19:15:47 +0100 From: Stefano Brivio To: Enrique Llorente Subject: Re: [PATCH v11] dhcp, dhcpv6: Add hostname and client fqdn ops Message-ID: <20250210191547.5cf0698a@elisabeth> In-Reply-To: <20250207113655.575213-1-ellorent@redhat.com> References: <20250207113655.575213-1-ellorent@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: -XP42Yg3qTREm2mUxIJxDQKqJh3D24dMOCm5yfOLoH0_1739211350 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 6Z6Y6NRWUBODQ52J6Q3JUKAH6X663YE6 X-Message-ID-Hash: 6Z6Y6NRWUBODQ52J6Q3JUKAH6X663YE6 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 Fri, 7 Feb 2025 12:36:55 +0100 Enrique Llorente wrote: > Both DHCPv4 and DHCPv6 has the capability to pass the hostname to > clients, the DHCPv4 uses option 12 (hostname) while the DHCPv6 uses option 39 > (client fqdn), for some virt deployments like kubevirt is expected to > have the VirtualMachine name as the guest hostname. > > This change add the following arguments: > - -H --hostname NAME to configure the hostname DHCPv4 option(12) > - --fqdn NAME to configure client fqdn option for both DHCPv4(81) and > DHCPv6(39) > > Signed-off-by: Enrique Llorente I tried to break it but this time my little hammer broke instead... Applied, thanks! I noticed one (pre-existing) issue: > +/* Total option size (excluding end option) is 576 (RFC 2131), minus > + * offset of options (268), minus end option and its length (2). > + */ > +#define OPT_MAX 306 > + > /** > * dhcp_init() - Initialise DHCP options > */ > @@ -122,7 +127,7 @@ struct msg { > uint8_t sname[64]; > uint8_t file[128]; > uint32_t magic; > - uint8_t o[308]; > + uint8_t o[OPT_MAX + 2 /* End option and its length */ ]; ...actually, option 255 is special in that it takes just one byte, because it has no length byte. I just assumed things from my memory without re-reading the RFC, sorry for that. That's RFC 2131, section 3.2. It's different from option 80, Rapid Commit, RFC 4039, which takes two bytes (zero length, and one length byte). So we should change the two code lines above, and drop my stupid: m->o[offset++] = 0; It's harmless because padding is harmless (option 0, also without length byte, taking one byte), but not needed, and we could stuff one extra byte in the response. -- Stefano