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:
parent
c69f5e0cb1
commit
1d7490bc7c
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user