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=DaRtTQlB; 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 6A7145A061D for ; Tue, 11 Feb 2025 12:14:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739272480; 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; bh=Wffi/EBTjU+4GYY2q+xPNSqfHI+rSZgXpawIkuW+ufU=; b=DaRtTQlBd9VTRczdbVAttJHNx5Gyu9l5Uivp6AQJJON3Ao7cchZeTW6TLWel2tbUw3R806 tg2GWuXhTODNVfMRQ5kMdCB7/Qksis49HEXa0N9VTN9fSd2eC+HE5uvqEtho+hXTd6P/kX Zq1iFFmglShgv6DAlJVIAKUc7gvyRpY= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-78-0RAKoDK3MN2AJ-_QiikduQ-1; Tue, 11 Feb 2025 06:14:38 -0500 X-MC-Unique: 0RAKoDK3MN2AJ-_QiikduQ-1 X-Mimecast-MFC-AGG-ID: 0RAKoDK3MN2AJ-_QiikduQ 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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A9B7B195609F for ; Tue, 11 Feb 2025 11:14:37 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.225.83]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8BC421800570; Tue, 11 Feb 2025 11:14:36 +0000 (UTC) From: Enrique Llorente To: passt-dev@passt.top Subject: [PATCH] dhcp: Remove option 255 length byte Date: Tue, 11 Feb 2025 12:14:34 +0100 Message-ID: <20250211111434.945152-1-ellorent@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: 7YKkXfpYSevWIEweMYWLG5LDLYpZzl-lF5A2sTqZaaA_1739272477 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: OKTGTCMPX26ONDOAW5W37XW2Y7JI7IDB X-Message-ID-Hash: OKTGTCMPX26ONDOAW5W37XW2Y7JI7IDB X-MailFrom: ellorent@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: Enrique Llorente 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: The option 255 (end of options) do not need the length byte, this change remove that allowing to have one extra byte at other dynamic options. Signed-off-by: Enrique Llorente --- dhcp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dhcp.c b/dhcp.c index 401cb5b..3aef13f 100644 --- a/dhcp.c +++ b/dhcp.c @@ -127,7 +127,7 @@ struct msg { uint8_t sname[64]; uint8_t file[128]; uint32_t magic; - uint8_t o[OPT_MAX + 2 /* End option and its length */ ]; + uint8_t o[OPT_MAX + 1 /* End option */ ]; } __attribute__((__packed__)); /** @@ -194,7 +194,6 @@ static int fill(struct msg *m) } m->o[offset++] = 255; - m->o[offset++] = 0; if (offset < OPT_MIN) { memset(&m->o[offset], 0, OPT_MIN - offset); -- 2.47.0