]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/spdk/dpdk/examples/ip_pipeline/tap.c
import 15.2.0 Octopus source
[ceph.git] / ceph / src / spdk / dpdk / examples / ip_pipeline / tap.c
index 11e4ad20e24f0a8092b5a492657f5e72db38e582..adae640c1e6b4a3d11d2cbdd962cf54384bb1c2f 100644 (file)
@@ -3,7 +3,7 @@
  */
 
 #include <netinet/in.h>
-#ifdef RTE_EXEC_ENV_LINUXAPP
+#ifdef RTE_EXEC_ENV_LINUX
 #include <linux/if.h>
 #include <linux/if_tun.h>
 #endif
@@ -46,7 +46,7 @@ tap_find(const char *name)
        return NULL;
 }
 
-#ifndef RTE_EXEC_ENV_LINUXAPP
+#ifndef RTE_EXEC_ENV_LINUX
 
 struct tap *
 tap_create(const char *name __rte_unused)
@@ -75,7 +75,7 @@ tap_create(const char *name)
 
        memset(&ifr, 0, sizeof(ifr));
        ifr.ifr_flags = IFF_TAP | IFF_NO_PI; /* No packet information */
-       snprintf(ifr.ifr_name, IFNAMSIZ, "%s", name);
+       strlcpy(ifr.ifr_name, name, IFNAMSIZ);
 
        status = ioctl(fd, TUNSETIFF, (void *) &ifr);
        if (status < 0) {