From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2097C42813 for ; Wed, 22 Mar 2023 22:24:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C261410EF; Wed, 22 Mar 2023 22:24:53 +0100 (CET) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by mails.dpdk.org (Postfix) with ESMTP id 05FC940395; Wed, 22 Mar 2023 22:24:49 +0100 (CET) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32MJJ5Ec023595; Wed, 22 Mar 2023 21:24:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=xf7VLmOuxs3+5BgR/N5HIOTY2Z424beoK6uKOjK+iPo=; b=qYOeUnBrl52zx9CKSy1WrEiZvFe6XBWzwDqVpnf2/1kJsdRrCIpjiO+WONbP2jOCC6sl lvXVhRX4NjnLEwaFG9V/Boxs5dGxJO9gymecGT+HjVf5VgvjbhqFuyeFmCWG10F3dqK5 SL6KBh0+N/jVtfcCNcuk3bDdKzTEDI8Nx7vH7r0/9NuQ7dBQXMu1rQ21icdjX7zG2aPy 6dCe95U5tKOGfC8RYkP5wkPQ4QZEcVe5TKl/W/Ja9i4luzzu7sQpOr2h9Lc4V+MZsy8c XEWGPctCm+EcGJAEKoqu308rBqNbBqIjgfLlIB5wSsyqzqO3OOwV6G23cp2Fsslft4Nq 5A== Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pg1faxgm9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Mar 2023 21:24:48 +0000 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32MKFq7R011928; Wed, 22 Mar 2023 21:24:48 GMT Received: from smtprelay06.wdc07v.mail.ibm.com ([9.208.129.118]) by ppma03dal.us.ibm.com (PPS) with ESMTPS id 3pd4x7gwqv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Mar 2023 21:24:47 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay06.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32MLOkdR11272888 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Mar 2023 21:24:46 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1782758060; Wed, 22 Mar 2023 21:24:46 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BEC5F58056; Wed, 22 Mar 2023 21:24:45 +0000 (GMT) Received: from ltc19u30.pok.stglabs.ibm.com (unknown [9.114.224.51]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 22 Mar 2023 21:24:45 +0000 (GMT) From: David Christensen To: dev@dpdk.org Cc: David Christensen , stable@dpdk.org Subject: [PATCH] net/tap: resolve stringop-overflow with gcc 12 on ppc64le Date: Wed, 22 Mar 2023 17:24:39 -0400 Message-Id: <20230322212439.524725-1-drc@linux.vnet.ibm.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: fY46-o3LPmIXSUng9fYCZ_7h27yVOzJ3 X-Proofpoint-ORIG-GUID: fY46-o3LPmIXSUng9fYCZ_7h27yVOzJ3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-22_18,2023-03-22_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 suspectscore=0 spamscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303220150 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Building DPDK with gcc 12 on a ppc64le system generates a stringop-overflow warning. Replace the local MAC address validation function parse_user_mac() with a call to rte_ether_unformat_addr() instead. Bugzilla ID: 1197 Cc: stable@dpdk.org Signed-off-by: David Christensen --- drivers/net/tap/rte_eth_tap.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 089ac202fa..1f83f49c0e 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -2267,29 +2267,6 @@ set_remote_iface(const char *key __rte_unused, return 0; } -static int parse_user_mac(struct rte_ether_addr *user_mac, - const char *value) -{ - unsigned int index = 0; - char mac_temp[strlen(ETH_TAP_USR_MAC_FMT) + 1], *mac_byte = NULL; - - if (user_mac == NULL || value == NULL) - return 0; - - strlcpy(mac_temp, value, sizeof(mac_temp)); - mac_byte = strtok(mac_temp, ":"); - - while ((mac_byte != NULL) && - (strlen(mac_byte) <= 2) && - (strlen(mac_byte) == strspn(mac_byte, - ETH_TAP_CMP_MAC_FMT))) { - user_mac->addr_bytes[index++] = strtoul(mac_byte, NULL, 16); - mac_byte = strtok(NULL, ":"); - } - - return index; -} - static int set_mac_type(const char *key __rte_unused, const char *value, @@ -2311,7 +2288,7 @@ set_mac_type(const char *key __rte_unused, goto success; } - if (parse_user_mac(user_mac, value) != 6) + if (rte_ether_unformat_addr(value, user_mac) < 0) goto error; success: TAP_LOG(DEBUG, "TAP user MAC param (%s)", value); -- 2.31.1