X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fip_pipeline%2Ftap.c;h=adae640c1e6b4a3d11d2cbdd962cf54384bb1c2f;hb=8723061aa65e2d1764994d810940d61c1f5948ee;hp=a0f60867f7546ff7d69b6d82a12700a2e7fca4ca;hpb=0015ea276725a5e2a8f634b76c67a524c0c0a3ca;p=dpdk.git diff --git a/examples/ip_pipeline/tap.c b/examples/ip_pipeline/tap.c index a0f60867f7..adae640c1e 100644 --- a/examples/ip_pipeline/tap.c +++ b/examples/ip_pipeline/tap.c @@ -3,7 +3,7 @@ */ #include -#ifdef RTE_EXEC_ENV_LINUXAPP +#ifdef RTE_EXEC_ENV_LINUX #include #include #endif @@ -15,6 +15,8 @@ #include #include +#include + #include "tap.h" #define TAP_DEV "/dev/net/tun" @@ -44,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) @@ -73,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) { @@ -88,7 +90,7 @@ tap_create(const char *name) return NULL; } /* Node fill in */ - strncpy(tap->name, name, sizeof(tap->name)); + strlcpy(tap->name, name, sizeof(tap->name)); tap->fd = fd; /* Node add to list */