]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - misc/arpd.c
libnetlink: Add filter function to rtnl_neighdump_req
[mirror_iproute2.git] / misc / arpd.c
index bfab44544ee1dd16b236915d1b50fdca3d0933ef..504961cb5e3a0e15f54132d881bd2829bac96912 100644 (file)
@@ -38,8 +38,6 @@
 #include "utils.h"
 #include "rt_names.h"
 
-int resolve_hosts;
-
 DB     *dbase;
 char   *dbname = "/var/lib/arpd/arpd.db";
 
@@ -426,7 +424,7 @@ static int do_one_request(struct nlmsghdr *n)
 
 static void load_initial_table(void)
 {
-       if (rtnl_wilddump_request(&rth, AF_INET, RTM_GETNEIGH) < 0) {
+       if (rtnl_neighdump_req(&rth, AF_INET, NULL) < 0) {
                perror("dump request failed");
                exit(1);
        }
@@ -664,7 +662,8 @@ int main(int argc, char **argv)
                struct ifreq ifr = {};
 
                for (i = 0; i < ifnum; i++) {
-                       strncpy(ifr.ifr_name, ifnames[i], IFNAMSIZ);
+                       if (get_ifname(ifr.ifr_name, ifnames[i]))
+                               invarg("not a valid ifname", ifnames[i]);
                        if (ioctl(udp_sock, SIOCGIFINDEX, &ifr)) {
                                perror("ioctl(SIOCGIFINDEX)");
                                exit(-1);