]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
iptoken: simplify iptoken_list a bit
authorPhil Sutter <phil@nwl.cc>
Tue, 24 Nov 2015 14:31:04 +0000 (15:31 +0100)
committerStephen Hemminger <shemming@brocade.com>
Sun, 29 Nov 2015 19:47:29 +0000 (11:47 -0800)
Since it uses only a single filter, rtnl_dump_filter() can be used.

Signed-off-by: Phil Sutter <phil@nwl.cc>
ip/iptoken.c

index a38194c9c08ef9882e2b4895fbb0b14004da598d..428f13320c3d287c4561e8d4d3a72571675c41d7 100644 (file)
@@ -95,10 +95,6 @@ static int iptoken_list(int argc, char **argv)
 {
        int af = AF_INET6;
        struct rtnl_dump_args da;
-       const struct rtnl_dump_filter_arg a[2] = {
-               { .filter = print_token, .arg1 = &da, },
-               { .filter = NULL, .arg1 = NULL, },
-       };
 
        memset(&da, 0, sizeof(da));
        da.fp = stdout;
@@ -118,7 +114,7 @@ static int iptoken_list(int argc, char **argv)
                return -1;
        }
 
-       if (rtnl_dump_filter_l(&rth, a) < 0) {
+       if (rtnl_dump_filter(&rth, print_token, &da) < 0) {
                fprintf(stderr, "Dump terminated\n");
                return -1;
        }