u8 *dev_net_dir;
DIR *dir;
- memset (&ifr, 0, sizeof (ifr));
+ clib_memset (&ifr, 0, sizeof (ifr));
dev_net_dir = format (0, "%s/%s%c", sysfs_class_net_path, upper_name, 0);
if (strncmp (e->d_name, "lower_", 6))
continue;
- strncpy (ifr.ifr_name, e->d_name + 6, IFNAMSIZ);
+ strncpy (ifr.ifr_name, e->d_name + 6, IFNAMSIZ - 1);
break;
}
closedir (dir);
}
- memset (&ifr, 0, sizeof (ifr));
- strncpy (ifr.ifr_name, ifname, IFNAMSIZ);
+ clib_memset (&ifr, 0, sizeof (ifr));
+ strncpy (ifr.ifr_name, ifname, IFNAMSIZ - 1);
/* read up/down flags */
fd = socket (PF_INET, SOCK_DGRAM, 0);