From patchwork Fri Jul 8 07:43:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ales Musil X-Patchwork-Id: 1653948 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=WAIuPkrd; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LfQHy2zG6z9s07 for ; Fri, 8 Jul 2022 17:43:26 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 8625884576; Fri, 8 Jul 2022 07:43:24 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 8625884576 Authentication-Results: smtp1.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=WAIuPkrd X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9SVxGCSEPvCB; Fri, 8 Jul 2022 07:43:23 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id A1E0284509; Fri, 8 Jul 2022 07:43:22 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org A1E0284509 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 730A9C0035; Fri, 8 Jul 2022 07:43:22 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id DE422C002D for ; Fri, 8 Jul 2022 07:43:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B861B401A4 for ; Fri, 8 Jul 2022 07:43:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org B861B401A4 Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WAIuPkrd X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q6YZ0Czj_Xkq for ; Fri, 8 Jul 2022 07:43:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org CC69B40192 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id CC69B40192 for ; Fri, 8 Jul 2022 07:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657266198; 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=y9wj3Lugj2vaarpSIS1d5e2HG6IKe/vLGRn7BnR31a0=; b=WAIuPkrdxwJ7BlgXtU529Ipw57ne70LrgwSSKqubhDp3QJnm0eM+kje0LX+J1XmededMVS ppm7Ihnkf2k/BCUQEW6c12F5BhylWFRxrGzh9dejal9aYW5wSte5862gIvZvm+gMsVAuwm Hb16SS5beXBNWXDjiInr18nLS3KbBgs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-223-pi2bra7oP9qLcU0rDsv_Ug-1; Fri, 08 Jul 2022 03:43:17 -0400 X-MC-Unique: pi2bra7oP9qLcU0rDsv_Ug-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 26BDB101A586 for ; Fri, 8 Jul 2022 07:43:17 +0000 (UTC) Received: from amusil.redhat.com (unknown [10.40.192.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id 36749C23DBF; Fri, 8 Jul 2022 07:43:16 +0000 (UTC) From: Ales Musil To: dev@openvswitch.org Date: Fri, 8 Jul 2022 09:43:15 +0200 Message-Id: <20220708074315.75289-1-amusil@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=amusil@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] ovn-nbctl: Fix priority arg of lrp-set-gateway-chassis X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" When the lrp-set-gateway-chassis was followed by chained command (--) the command tried to parse -- as priority when the priority was not specified. Check if the command argument count is actually 4 instead of checking argv[3]. Reported-at: https://bugzilla.redhat.com/2102930 Signed-off-by: Ales Musil --- utilities/ovn-nbctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c index 0d5647b2f..3bbdbd998 100644 --- a/utilities/ovn-nbctl.c +++ b/utilities/ovn-nbctl.c @@ -5366,7 +5366,7 @@ nbctl_lrp_set_gateway_chassis(struct ctl_context *ctx) } const char *chassis_name = ctx->argv[2]; - if (ctx->argv[3]) { + if (ctx->argc == 4) { error = parse_priority(ctx->argv[3], &priority); if (error) { ctx->error = error;