From patchwork Fri Mar 1 20:03:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Michelson X-Patchwork-Id: 1906887 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=JgyCRHA0; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 4TmfDv4Xylz23q2 for ; Sat, 2 Mar 2024 07:04:15 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 43E7141FA0; Fri, 1 Mar 2024 20:04:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rGRdpbbb9O0I; Fri, 1 Mar 2024 20:04:11 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 33E3C41F57 Authentication-Results: smtp4.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=JgyCRHA0 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 33E3C41F57; Fri, 1 Mar 2024 20:04:11 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0C01FC0077; Fri, 1 Mar 2024 20:04:11 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2C17DC0037 for ; Fri, 1 Mar 2024 20:04:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 1C71A83B55 for ; Fri, 1 Mar 2024 20:04:10 +0000 (UTC) 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 DW1Y9v4TR8Cz for ; Fri, 1 Mar 2024 20:04:09 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=mmichels@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 24AF683A8E Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 24AF683A8E Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JgyCRHA0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 24AF683A8E for ; Fri, 1 Mar 2024 20:04:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709323447; 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=Wa90iOwtBacfbaOsbZfLnNYEdb8mAr4WZgB42/TmBW0=; b=JgyCRHA0ov2JU2hY/NT0UwGbm1OrVptLEOLutTF3bquieRCayN+Q5RswQIcc9JvBSZaaRy JbrKMYt26XrWISFNAXHMAHQ7sCO9iordbBm3D34OCpIiBv8Lo0rQsEiDoSiYP5s/ovLfQT KkHoPOZ4tVj6nhesicSP167hgEo5a+I= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-369-h4h3MX4HPoeh0v_aCxRRfQ-1; Fri, 01 Mar 2024 15:04:05 -0500 X-MC-Unique: h4h3MX4HPoeh0v_aCxRRfQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id D701B28AC1DD for ; Fri, 1 Mar 2024 20:04:04 +0000 (UTC) Received: from localhost.redhat.com (unknown [10.22.48.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B0351121306 for ; Fri, 1 Mar 2024 20:04:04 +0000 (UTC) From: Mark Michelson To: dev@openvswitch.org Date: Fri, 1 Mar 2024 15:03:58 -0500 Message-ID: <20240301200403.2079022-1-mmichels@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] acl-log: Properly log the "pass" verdict. 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" The "pass" verdict was not explicitly defined in the list of verdicts for ACL logging. This resulted in logs saying "Syntax error at `pass' unknown verdict." This change adds the "pass" verdict explicitly so that it shows up as a proper log in ovn-controller. Reported-at: https://issues.redhat.com/browse/FDP-442 Signed-off-by: Mark Michelson --- lib/acl-log.c | 4 +++- lib/acl-log.h | 1 + lib/actions.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/acl-log.c b/lib/acl-log.c index 9530dd763..b3eb4bbd0 100644 --- a/lib/acl-log.c +++ b/lib/acl-log.c @@ -34,7 +34,9 @@ log_verdict_to_string(uint8_t verdict) return "drop"; } else if (verdict == LOG_VERDICT_REJECT) { return "reject"; - } else { + } else if (verdict == LOG_VERDICT_PASS) { + return "pass"; + } else { return ""; } } diff --git a/lib/acl-log.h b/lib/acl-log.h index da7fa2f02..3973a8e0b 100644 --- a/lib/acl-log.h +++ b/lib/acl-log.h @@ -33,6 +33,7 @@ enum log_verdict { LOG_VERDICT_ALLOW, LOG_VERDICT_DROP, LOG_VERDICT_REJECT, + LOG_VERDICT_PASS, LOG_VERDICT_UNKNOWN = UINT8_MAX }; diff --git a/lib/actions.c b/lib/actions.c index a45874dfb..99aa563f2 100644 --- a/lib/actions.c +++ b/lib/actions.c @@ -3570,6 +3570,8 @@ parse_log_arg(struct action_context *ctx, struct ovnact_log *log) log->verdict = LOG_VERDICT_REJECT; } else if (lexer_match_id(ctx->lexer, "allow")) { log->verdict = LOG_VERDICT_ALLOW; + } else if (lexer_match_id(ctx->lexer, "pass")) { + log->verdict = LOG_VERDICT_PASS; } else { lexer_syntax_error(ctx->lexer, "unknown verdict"); return;