From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 3ABFCE5D for ; Mon, 30 Apr 2018 16:07:47 +0200 (CEST) Received: by mail-wr0-f194.google.com with SMTP id p5-v6so8160626wre.12 for ; Mon, 30 Apr 2018 07:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vO0HxIKB/S2CgIBzDRgRA8E9UxF1LVJtq8a8gBduPfU=; b=eY9EKF0bNSb6+yO8n3AtYRWI3M6KcT/v1wezKuChmLBpNk1wwTNEV/JWOj6HlYwzAt 7qXRg3zy59sBOzjxdUnjEmci0NolhTGV6b7cHaO55qJ1L8lxGkSXE40Qz0tmv/an5p5Q 4NuaKS8CIBMYZf3wZnAMt2IRv71L91O4nkefxkQALhXofu6z7YnyR/YJhmdEFmSrXF6T mfRI+mozQxnh9jEnGUzQGM7Teigvi4jnK3kOYnC5fqQK0+taVyOcxImna6+QH8NsubDB MWweiGs3SVCLdZexB/lhIOnF14pPs9pP7b1jQzYifiaiVFN9YoqIivOCYlx6jDvrWNhy DD5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vO0HxIKB/S2CgIBzDRgRA8E9UxF1LVJtq8a8gBduPfU=; b=G1gaCfpwnPEcOULrrg84mxiJjH2gwHhD3CCqMwAedxr9ehZT77FNF4z64x0cDPsmYd QqFI2tU39o+vjPQ+QNvt5xjyvAhPYDmeroBE+ZnVFfhI5pJY/XgaOd9xHUHGT1us3pOa hOyuvhBcI0ZoQEQ57UlC5dhQPWyiCXGJgb6nqagJFGPDV1cuX3mzXRjkz/8bS2ySZzPD 0qsl51rkGQtspiCKoqIwdZ+7fO6OyukXcVms/HZpdMPBl5C8LYGdSLzun7G91Yp6ONrd 3bsVraRR6NfIDpSbH2wBedO136YAkNwpkoBhBsNtU53yssakCjoZ17o99Fr3fGk5bvOS wVbQ== X-Gm-Message-State: ALQs6tBYOzAVFk3E5B1GY+dKcMWMbIWUm2+CCForKjWkfY75PRXHXDYA 3ll5ePyBaygZYdJPOCZSFcQ= X-Google-Smtp-Source: AB8JxZokcp8/11ETpdY6awcgRkCmgJySfk67cVJxT3J65SxZRR8ytlVV8e9B/P3QeEiQJ6D3GhtIow== X-Received: by 2002:adf:bb14:: with SMTP id r20-v6mr8566483wrg.244.1525097266987; Mon, 30 Apr 2018 07:07:46 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id e50-v6sm20648376wre.4.2018.04.30.07.07.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 07:07:46 -0700 (PDT) From: luca.boccassi@gmail.com To: Mohammad Abdul Awal Cc: Konstantin Ananyev , dpdk stable Date: Mon, 30 Apr 2018 15:03:30 +0100 Message-Id: <20180430140606.4615-52-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180430140606.4615-1-luca.boccassi@gmail.com> References: <20180430140606.4615-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'ethdev: fix string length in name comparison' has been queued to stable release 18.02.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 14:07:47 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 9fd333a15a0997a1585b6616427c83edbbe3fbf4 Mon Sep 17 00:00:00 2001 From: Mohammad Abdul Awal Date: Tue, 27 Feb 2018 08:58:27 +0000 Subject: [PATCH] ethdev: fix string length in name comparison [ upstream commit b4572daa2c1056ba5a346841135747e8a2ea356e ] The current code compares two strings upto the length of 1st string (searched name). If the 1st string is prefix of 2nd string (existing name), the string comparison returns the port_id of earliest prefix matches. This patch fixes the bug by using strcmp instead of strncmp. Fixes: 9c5b8d8b9fe ("ethdev: clean port id retrieval when attaching") Signed-off-by: Mohammad Abdul Awal Acked-by: Konstantin Ananyev --- lib/librte_ether/rte_ethdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 0590f0c10..3b885a62c 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -572,8 +572,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id) for (pid = 0; pid < RTE_MAX_ETHPORTS; pid++) { if (rte_eth_devices[pid].state != RTE_ETH_DEV_UNUSED && - !strncmp(name, rte_eth_dev_shared_data->data[pid].name, - strlen(name))) { + !strcmp(name, rte_eth_dev_shared_data->data[pid].name)) { *port_id = pid; return 0; } -- 2.14.2