[v2,1/7] net/tap: use strlcpy for interface name

Message ID 20190111203520.19944-2-stephen@networkplumber.org
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • net/tap: fixes and cleanups
Related show

Checks

Context Check Description
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Jan. 11, 2019, 8:35 p.m.
snprintf is not needed here, use strlcpy instead.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by Keith Wiles <keith.wiles@intel.com>
---
 drivers/net/tap/rte_eth_tap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 0ec030bef63c..1c00681ba0eb 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -148,7 +148,7 @@  tun_alloc(struct pmd_internals *pmd, int is_keepalive)
 	 */
 	ifr.ifr_flags = (pmd->type == ETH_TUNTAP_TYPE_TAP) ?
 		IFF_TAP : IFF_TUN | IFF_POINTOPOINT;
-	snprintf(ifr.ifr_name, IFNAMSIZ, "%s", pmd->name);
+	strlcpy(ifr.ifr_name, pmd->name, IFNAMSIZ);
 
 	TAP_LOG(DEBUG, "ifr_name '%s'", ifr.ifr_name);