From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A4648A0588; Wed, 8 Apr 2020 00:48:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 841FC1BFE6; Wed, 8 Apr 2020 00:48:35 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 39C6F1BFB7; Wed, 8 Apr 2020 00:48:34 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id C8A6A5C0196; Tue, 7 Apr 2020 18:48:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 07 Apr 2020 18:48:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=mesmtp; bh=XsXk9JIiG5j44th4t8d1pwm +wyInRGUpdy2UaaxsrDk=; b=RlX3dVeLWZLuOD7jwXW8PbGRUDM09HSK6o1nqob g3YHZAou/doqxrvzj5lD35JAoI55ynHyg5mAmbz1eGD+SaKbi+uqDJHFM/EbZsbQ WoS/5vq7IKGnU39qXzljj9yi1Dr9PG1cegkFb2bwEl+ViqI5Jq9F2OUE79Omik6w pfxk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=XsXk9JIiG5j44th4t 8d1pwm+wyInRGUpdy2UaaxsrDk=; b=IzTYhokexZltuYGpxj/IAE/9GCF/YTsO+ iOxqUfgAQQHkRGNwZVlNAMexuBGGq8UpNEUoNht0xniF18Xut6e1umTHE9quMQ1K us4ArBc4RibNagbuQ8iPTdneECmC8TmkJtLCDqpBeyvt3+oq1Eyqhl1zCRVElBl4 q/rBEgAkUuoEr1XNNoblzYLM62wu327U8Sa1wkfnibmqgHcJnFd95TnsGCbCNj4i IIXQfx3ACCQGgtdv5BklcyyZRcmuB8bdmPvf3OyD5ok90k4ig7cvASqlbOCWOfOY HY6oS+9XvqTb0s71Sns6ULuUD7xobvff2icMu+fm+0L5B5C2UYDqA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeigddugecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghsucfo ohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkphepje ejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 39E94306D616; Tue, 7 Apr 2020 18:48:32 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ivan.malov@oktetlabs.ru, arybchenko@solarflare.com, stephen@networkplumber.org, stable@dpdk.org, Ferruh Yigit Date: Wed, 8 Apr 2020 00:47:58 +0200 Message-Id: <20200407224758.57459-1-thomas@monjalon.net> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] log: fix level picked with globbing on type register X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When a log type is registered, the level can be picked by matching saved options. The check of fnmatch globbing result was reversed. The same bug was already fixed in a similar function. This one is acting in log type register function. Note: this function rte_log_register_type_and_pick_level() is not used a lot and could be merged with rte_log_register(). Fixes: 6ff0f81d0ef7 ("log: fix pattern matching") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- lib/librte_eal/common/eal_common_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c index 7647a916ef..d7a5f9b641 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -320,7 +320,7 @@ rte_log_register_type_and_pick_level(const char *name, uint32_t level_def) continue; if (opt_ll->pattern) { - if (fnmatch(opt_ll->pattern, name, 0)) + if (fnmatch(opt_ll->pattern, name, 0) == 0) level = opt_ll->level; } else { if (regexec(&opt_ll->re_match, name, 0, NULL, 0) == 0) -- 2.26.0