net/tap: use strlcpy for interface name

snprintf is not needed here, use strlcpy instead.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by Keith Wiles <keith.wiles@intel.com>
This commit is contained in:
Stephen Hemminger 2019-01-11 12:35:14 -08:00 committed by Ferruh Yigit
parent c69f5e0cb1
commit 1d7490bc7c

View File

@ -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);