int fd;
int err;
- strncpy(ifr.ifr_name, basedev, IFNAMSIZ);
+ strlcpy(ifr.ifr_name, basedev, IFNAMSIZ);
ifr.ifr_ifru.ifru_data = (void *)p;
fd = socket(preferred_family, SOCK_DGRAM, 0);
int err;
if (cmd == SIOCCHGTUNNEL && name[0])
- strncpy(ifr.ifr_name, name, IFNAMSIZ);
+ strlcpy(ifr.ifr_name, name, IFNAMSIZ);
else
- strncpy(ifr.ifr_name, basedev, IFNAMSIZ);
+ strlcpy(ifr.ifr_name, basedev, IFNAMSIZ);
ifr.ifr_ifru.ifru_data = p;
fd = socket(preferred_family, SOCK_DGRAM, 0);
int err;
if (name[0])
- strncpy(ifr.ifr_name, name, IFNAMSIZ);
+ strlcpy(ifr.ifr_name, name, IFNAMSIZ);
else
- strncpy(ifr.ifr_name, basedev, IFNAMSIZ);
+ strlcpy(ifr.ifr_name, basedev, IFNAMSIZ);
ifr.ifr_ifru.ifru_data = p;
int fd;
int err;
- strncpy(ifr.ifr_name, name, IFNAMSIZ);
+ strlcpy(ifr.ifr_name, name, IFNAMSIZ);
ifr.ifr_ifru.ifru_data = p;
fd = socket(preferred_family, SOCK_DGRAM, 0);
s->tx_carrier_errors, s->tx_dropped);
}
-static int print_nlmsg_tunnel(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int print_nlmsg_tunnel(struct nlmsghdr *n, void *arg)
{
struct tnl_print_nlmsg_info *info = arg;
struct ifinfomsg *ifi = NLMSG_DATA(n);
int do_tunnels_list(struct tnl_print_nlmsg_info *info)
{
- if (rtnl_wilddump_request(&rth, preferred_family, RTM_GETLINK) < 0) {
+ if (rtnl_linkdump_req(&rth, preferred_family) < 0) {
perror("Cannot send dump request\n");
return -1;
}