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=A4QpPaQ8; 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 08DD95A0657 for ; Tue, 05 May 2026 01:10:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777936239; 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=qWkiPwqDVVxqGOcyYzmV8DIklxXXrp+gqp/IbO+jAqs=; b=A4QpPaQ8vLlJsm+/8AGBCNqtojul1yzFGNlHtiIP4mRe1vpeAEy4ard4ZVVV+s8bFFjvNL 0Q9xVVayvtUdk/bgcOzHQFTI2bUuwfPMZhJXD1RBfkUBusC6ShhoHwhoL0hfDS0u3X49oH QgADaSlxynsZLKG6MN/JuIQBLMoIFMI= 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-372-kJ6-TNexPOiUR-tx5ikEJw-1; Mon, 04 May 2026 19:10:38 -0400 X-MC-Unique: kJ6-TNexPOiUR-tx5ikEJw-1 X-Mimecast-MFC-AGG-ID: kJ6-TNexPOiUR-tx5ikEJw_1777936238 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-488f973ddfeso32829085e9.3 for ; Mon, 04 May 2026 16:10:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777936237; x=1778541037; 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=qWkiPwqDVVxqGOcyYzmV8DIklxXXrp+gqp/IbO+jAqs=; b=PeN85pv3GITndkNGhCXNDJG/l5S/Gk5pPywiHMyJ+HMHxlSiom7DwIS3mEt9sQdk06 BTmQEK6rLvYlT3hbQnATEy6m4ot1Y7jc78kfjZTWmFjVDbePgJ0uyTa3z4l5g1y6EPCZ fbbjhd3RvH4cZKXD+U5Bb//eGR2UixjVpqH6E2LuHVBnQoyNxHcH7QD6ldgBbqUegCw3 O/0hYx+GsriCyv5Kn8scf1k6mVP4P2ltQrZ4T4UYrP+N+stFFOrBDb43eKGvJnEaYMVF ttrKWuy+dvgXcZAbbYbu1zSG6iFaoDoYg4EKbmlduR25yoaQtSAMyyHT2I4bn8H5cikb ZNuA== X-Gm-Message-State: AOJu0Yyo9Th8lEyIQo3Vi+/TpKyKVFcrCZdhZPkjQDYX3Q3bBn3/S8ur 9twK4hoLra19ZwIDmr3axhYqLS4CgDpND2BSys+4JkNnoRrO/M0y5qmK39QbZk3ZdOVd3uUJeBi yU6K8yFV+tFCPsvvw9IsFIla75R387PE+dmKFjw0guQOnaOaEAQVGHg== X-Gm-Gg: AeBDieuvxg1qb1sI+/804Ag1ehzzi+cj4iuoxdx6JWS8RztmfXglZeWeuKrLq3WimjZ WxIcNYdpBIEKMqwK0CXCUPjrC2YQhJ+ps+sIG5vnyhEoinNsI+NQSfRAueNyVJ8s5c+ozSCFQKK 5Gx1iksQDhf+bFj9DUGsxMcp2a8Zl0U3SY80t65U8a95vUsgF2CfDUztkuUNliAkAHITVDLxx3i Vj3WGraJDLtbqHSpIUt1Dk9Bd16Ev1/QWUXQjhMtxZXmVwfGXytSiKNFFscSG1hS/3Agiri4s/N w9juGwI5HpF7ejoy8IzS2e0TsCwibQHhBLoc0n1wfpNzyACS6UYQwlcGPugv83H4Tv5b7I8WorK XKIVDnsVoWF7Oq/nVBMEEhCuFnzekHhMijf/iC+j+JHeHqG3VaiL3ncd5Hy0I X-Received: by 2002:a05:600c:859a:b0:48a:525b:e157 with SMTP id 5b1f17b1804b1-48a9865f870mr136247695e9.13.1777936237493; Mon, 04 May 2026 16:10:37 -0700 (PDT) X-Received: by 2002:a05:600c:859a:b0:48a:525b:e157 with SMTP id 5b1f17b1804b1-48a9865f870mr136247525e9.13.1777936237008; Mon, 04 May 2026 16:10:37 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45028c24c52sm648622f8f.15.2026.05.04.16.10.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2026 16:10:36 -0700 (PDT) From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH v6 06/18] pif: Limit pif names to 128 bytes Message-ID: <20260505011035.6915f9ec@elisabeth> In-Reply-To: <0834495e-1818-406a-8737-c8e48a4cea6d@redhat.com> References: <20260503215601.823029-1-sbrivio@redhat.com> <20260503215601.823029-7-sbrivio@redhat.com> <0834495e-1818-406a-8737-c8e48a4cea6d@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: Tue, 05 May 2026 01:10:35 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: _cdtM_H7MyJeEsSdCEYzuQs3MjmEgQkCE01fKXPm1nc_1777936238 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: IUFA3TVYAY44RFM2N4BLVO2WDFNZZNNF X-Message-ID-Hash: IUFA3TVYAY44RFM2N4BLVO2WDFNZZNNF 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, Jon Maloy , David Gibson 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 Mon, 4 May 2026 11:12:16 +0200 Laurent Vivier wrote: > On 5/3/26 23:55, Stefano Brivio wrote: > > From: David Gibson > > > > All current pif names are quite short, and we expect them to remain short > > when/if we allow arbitrary pifs. However, because of the structure of > > the current code we don't enforce any limit on the length. > > > > This will become more important with dynamic configuration updates, so > > start enforcing a length limit. Specifically we allow pif names to be up > > to 128 bytes (PIF_NAME_SIZE), including the terminating \0. This is > > more or less arbitrary, but seems like it should be comfortably enough for > > all the cases we have in mind. > > > > Signed-off-by: David Gibson > > Signed-off-by: Stefano Brivio > > Reviewed-by: Laurent Vivier > > There is a little typo below > > > --- > > pif.c | 2 +- > > pif.h | 5 ++++- > > 2 files changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/pif.c b/pif.c > > index 1e80724..d5e3161 100644 > > --- a/pif.c > > +++ b/pif.c > > @@ -17,7 +17,7 @@ > > #include "inany.h" > > #include "epoll_ctl.h" > > > > -const char *pif_type_str[] = { > > +const char pif_type_str[][PIF_NAME_SIZE] = { > > [PIF_NONE] = "", > > [PIF_HOST] = "HOST", > > [PIF_TAP] = "TAP", > > diff --git a/pif.h b/pif.h > > index 7bb58e5..90dd3a3 100644 > > --- a/pif.h > > +++ b/pif.h > > @@ -35,7 +35,9 @@ enum pif_type { > > PIF_NUM_TYPES, > > }; > > > > -extern const char *pif_type_str[]; > > +/* Maxmimum size of a pif name, including \0 */ > > "Maximum" Fixed in v7. -- Stefano