]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - ip/tunnel.c
iproute: Set ip/ip6 lwtunnel flags
[mirror_iproute2.git] / ip / tunnel.c
index 7030995cd61ab0245bebb7440d488e985803adc8..d0d55f37169e9f522e39453b894b61f9bbf0200e 100644 (file)
@@ -65,7 +65,7 @@ int tnl_get_ioctl(const char *basedev, void *p)
        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);
@@ -90,9 +90,9 @@ int tnl_add_ioctl(int cmd, const char *basedev, const char *name, void *p)
        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);
@@ -116,9 +116,9 @@ int tnl_del_ioctl(const char *basedev, const char *name, void *p)
        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;
 
@@ -143,7 +143,7 @@ static int tnl_gen_ioctl(int cmd, const char *name,
        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);
@@ -321,8 +321,7 @@ static void tnl_print_stats(const struct rtnl_link_stats64 *s)
               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);
@@ -392,7 +391,7 @@ static int print_nlmsg_tunnel(const struct sockaddr_nl *who,
 
 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;
        }