#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <sys/ioctl.h>
#define NETMAP_WITH_LIBS
#include <net/netmap_user.h>
}
#endif /* __linux__ */
bzero(&ifr, sizeof(ifr));
- strncpy(ifr.ifr_name, d->req.nr_name, sizeof(ifr.ifr_name));
+ /*
+ * ifreq.ifr_name and nmreq.nr_name have the same size and both
+ * contain a NUL-terminated string.
+ */
+ (void)pcapint_strlcpy(ifr.ifr_name, d->req.nr_name, sizeof(ifr.ifr_name));
switch (what) {
case SIOCSIFFLAGS:
/*