From patchwork Fri Oct 10 16:09:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eelco Chaudron X-Patchwork-Id: 2148349 X-Patchwork-Delegate: echaudro@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QJXP7jpd; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4cjsDk4tThz1yGy for ; Sat, 11 Oct 2025 03:11:18 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id E7D2B61519; Fri, 10 Oct 2025 16:11:16 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 2ayU7Qy9hx7b; Fri, 10 Oct 2025 16:11:16 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0B30F60D5B Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QJXP7jpd Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0B30F60D5B; Fri, 10 Oct 2025 16:11:16 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E3A70C060E; Fri, 10 Oct 2025 16:11:15 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id EC0CCC060D for ; Fri, 10 Oct 2025 16:11:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id CE215614E7 for ; Fri, 10 Oct 2025 16:11:14 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id YdWL3Sy7iD7Q for ; Fri, 10 Oct 2025 16:11:13 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=echaudro@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 48B8D60D5B Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 48B8D60D5B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 48B8D60D5B for ; Fri, 10 Oct 2025 16:11:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760112671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q6zQeRm1XhmBcAhA777opis9ekWbQ9CRYkEEgLL8SLw=; b=QJXP7jpduuDXxiNOmhj+nIjysFb1c3Xs7Nekf5UHiutADMWt+cF/7SJdWxKb+5ANv0JftS jqcyRFBNDWu0A81x6Cg7rlelKTr69eft3+sRg/Wo3YmrWYnlzxq8bCaNAJ7rQS5IQ5OW0A aD8eohJsGWDP50rL3IAW59MIfZBPISI= Received: from mx-prod-mc-03.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-354-oBp9oypQNXK60Vm-yxRR3g-1; Fri, 10 Oct 2025 12:11:10 -0400 X-MC-Unique: oBp9oypQNXK60Vm-yxRR3g-1 X-Mimecast-MFC-AGG-ID: oBp9oypQNXK60Vm-yxRR3g_1760112669 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7EF271955DDB for ; Fri, 10 Oct 2025 16:11:09 +0000 (UTC) Received: from ebuild.redhat.com (unknown [10.44.32.55]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A3E5A30002D0 for ; Fri, 10 Oct 2025 16:11:08 +0000 (UTC) To: dev@openvswitch.org Date: Fri, 10 Oct 2025 18:09:58 +0200 Message-ID: <240e4b9059fd0c3afced27edf7a96b7842b39777.1760112598.git.echaudro@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: tVRbiiVCy0Aq30bO3YTWuWft6ShxQ6nJWOjvzI5RxeA_1760112669 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH] netdev-vport: Free error string from str_to_u8() in tunnel config. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Eelco Chaudron via dev From: Eelco Chaudron Reply-To: Eelco Chaudron Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Free the error string returned by str_to_u8() in set_tunnel_config(). While at it, also add a proper error message for this error case. Fixes: ebe0e518b048 ("tunnel: Bareudp Tunnel Support.") Signed-off-by: Eelco Chaudron Acked-by: Kevin Traynor --- lib/netdev-vport.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index ed67b509d..d11269d00 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -813,9 +813,13 @@ set_tunnel_config(struct netdev *dev_, const struct smap *args, char **errp) tnl_cfg.exts |= (1 << OVS_BAREUDP_EXT_MULTIPROTO_MODE); } else { uint16_t payload_ethertype; + char *error = str_to_u16(node->value, "payload_type", + &payload_ethertype); - if (str_to_u16(node->value, "payload_type", - &payload_ethertype)) { + if (error) { + free(error); + ds_put_format(&errors, "%s: bad %s 'payload_type'\n", + name, node->value); err = EINVAL; goto out; }