]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
libnetlink: remove unused junk callback
authorStephen Hemminger <shemminger@vyatta.com>
Wed, 28 Dec 2011 18:37:12 +0000 (10:37 -0800)
committerStephen Hemminger <shemminger@vyatta.com>
Wed, 28 Dec 2011 18:37:12 +0000 (10:37 -0800)
Both rtnl_talk and rtnl_dump had a callback for handling portions
of netlink message that do not match the correct pid or seq.
But this callback was never used by any part of iproute2 so remove
it.

20 files changed:
genl/ctrl.c
include/libnetlink.h
ip/ipaddress.c
ip/ipaddrlabel.c
ip/iplink.c
ip/ipneigh.c
ip/ipntable.c
ip/iproute.c
ip/iprule.c
ip/link_gre.c
ip/rtmon.c
ip/xfrm_policy.c
ip/xfrm_state.c
lib/libnetlink.c
lib/ll_map.c
misc/ifstat.c
tc/m_action.c
tc/tc_class.c
tc/tc_filter.c
tc/tc_qdisc.c

index 38a9761329fda0dcabdcbde4e9a5a27d6179494f..58d13bedc4373d627e0b004376bdb8b2371e4d84 100644 (file)
@@ -67,7 +67,7 @@ int genl_ctrl_resolve_family(const char *family)
 
        addattr_l(nlh, 128, CTRL_ATTR_FAMILY_NAME, family, strlen(family) + 1);
 
-       if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL) < 0) {
+       if (rtnl_talk(&rth, nlh, 0, 0, nlh) < 0) {
                fprintf(stderr, "Error talking to the kernel\n");
                goto errout;
        }
@@ -334,7 +334,7 @@ static int ctrl_list(int cmd, int argc, char **argv)
                        goto ctrl_done;
                }
 
-               if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL) < 0) {
+               if (rtnl_talk(&rth, nlh, 0, 0, nlh) < 0) {
                        fprintf(stderr, "Error talking to the kernel\n");
                        goto ctrl_done;
                }
@@ -355,7 +355,7 @@ static int ctrl_list(int cmd, int argc, char **argv)
                        goto ctrl_done;
                }
 
-               rtnl_dump_filter(&rth, print_ctrl, stdout, NULL, NULL);
+               rtnl_dump_filter(&rth, print_ctrl, stdout);
 
         }
 
index c54c7f6b180aa0326b372daacff244dc4999d375..a828032df7c95f9f39f25aeb9853dd540e36792a 100644 (file)
@@ -32,21 +32,14 @@ struct rtnl_dump_filter_arg
 {
        rtnl_filter_t filter;
        void *arg1;
-       rtnl_filter_t junk;
-       void *arg2;
 };
 
 extern int rtnl_dump_filter_l(struct rtnl_handle *rth,
                              const struct rtnl_dump_filter_arg *arg);
 extern int rtnl_dump_filter(struct rtnl_handle *rth, rtnl_filter_t filter,
-                           void *arg1,
-                           rtnl_filter_t junk,
-                           void *arg2);
-
+                           void *arg);
 extern int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
-                    unsigned groups, struct nlmsghdr *answer,
-                    rtnl_filter_t junk,
-                    void *jarg);
+                    unsigned groups, struct nlmsghdr *answer);
 extern int rtnl_send(struct rtnl_handle *rth, const void *buf, int);
 extern int rtnl_send_check(struct rtnl_handle *rth, const void *buf, int);
 
@@ -74,8 +67,8 @@ extern int __parse_rtattr_nested_compat(struct rtattr *tb[], int max, struct rta
        (parse_rtattr((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta)))
 
 #define parse_rtattr_nested_compat(tb, max, rta, data, len) \
-({     data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \
-       __parse_rtattr_nested_compat(tb, max, rta, len); })
+       ({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL;       \
+               __parse_rtattr_nested_compat(tb, max, rta, len); })
 
 extern int rtnl_listen(struct rtnl_handle *, rtnl_filter_t handler,
                       void *jarg);
index 2f2cabdffcf38b591aac5d235d37127706ec0b1e..4a0ffd67bdf9377fa57cec325e3c1effef5e7758 100644 (file)
@@ -833,7 +833,7 @@ static int ipaddr_list_or_flush(int argc, char **argv, int flush)
                exit(1);
        }
 
-       if (rtnl_dump_filter(&rth, store_nlmsg, &linfo, NULL, NULL) < 0) {
+       if (rtnl_dump_filter(&rth, store_nlmsg, &linfo) < 0) {
                fprintf(stderr, "Dump terminated\n");
                exit(1);
        }
@@ -859,20 +859,14 @@ static int ipaddr_list_or_flush(int argc, char **argv, int flush)
                                {
                                        .filter = print_addrinfo_secondary,
                                        .arg1 = stdout,
-                                       .junk = NULL,
-                                       .arg2 = NULL
                                },
                                {
                                        .filter = print_addrinfo_primary,
                                        .arg1 = stdout,
-                                       .junk = NULL,
-                                       .arg2 = NULL
                                },
                                {
                                        .filter = NULL,
                                        .arg1 = NULL,
-                                       .junk = NULL,
-                                       .arg2 = NULL
                                },
                        };
                        if (rtnl_wilddump_request(&rth, filter.family, RTM_GETADDR) < 0) {
@@ -923,7 +917,7 @@ flush_done:
                        exit(1);
                }
 
-               if (rtnl_dump_filter(&rth, store_nlmsg, &ainfo, NULL, NULL) < 0) {
+               if (rtnl_dump_filter(&rth, store_nlmsg, &ainfo) < 0) {
                        fprintf(stderr, "Dump terminated\n");
                        exit(1);
                }
@@ -1214,7 +1208,7 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv)
                          sizeof(cinfo));
        }
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                return -2;
 
        return 0;
index a71855d75d200b1663cd6a99107fcbfce972cf4f..eb6a48c4dac6d54a0e5712b3a39938f8c225c901 100644 (file)
@@ -114,7 +114,7 @@ static int ipaddrlabel_list(int argc, char **argv)
                return 1;
        }
 
-       if (rtnl_dump_filter(&rth, print_addrlabel, stdout, NULL, NULL) < 0) {
+       if (rtnl_dump_filter(&rth, print_addrlabel, stdout) < 0) {
                fprintf(stderr, "Dump terminated\n");
                return 1;
        }
@@ -183,7 +183,7 @@ static int ipaddrlabel_modify(int cmd, int argc, char **argv)
        if (req.ifal.ifal_family == AF_UNSPEC)
                req.ifal.ifal_family = AF_INET6;
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                return 2;
 
        return 0;
@@ -210,7 +210,7 @@ static int flush_addrlabel(const struct sockaddr_nl *who, struct nlmsghdr *n, vo
                if (rtnl_open(&rth2, 0) < 0)
                        return -1;
 
-               if (rtnl_talk(&rth2, n, 0, 0, NULL, NULL, NULL) < 0)
+               if (rtnl_talk(&rth2, n, 0, 0, NULL) < 0)
                        return -2;
 
                rtnl_close(&rth2);
@@ -236,7 +236,7 @@ static int ipaddrlabel_flush(int argc, char **argv)
                return 1;
        }
 
-       if (rtnl_dump_filter(&rth, flush_addrlabel, NULL, NULL, NULL) < 0) {
+       if (rtnl_dump_filter(&rth, flush_addrlabel, NULL) < 0) {
                fprintf(stderr, "Flush terminated\n");
                return 1;
        }
index d41605b379e0027d4fee211634eba394a87a61e4..6b051b65faab72ea46534ad33f71b3f6cd35c11b 100644 (file)
@@ -482,7 +482,7 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
 
                        req.i.ifi_index = 0;
                        addattr32(&req.n, sizeof(req), IFLA_GROUP, group);
-                       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+                       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                                exit(2);
                        return 0;
                }
@@ -559,7 +559,7 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
                addattr_l(&req.n, sizeof(req), IFLA_IFNAME, name, len);
        }
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                exit(2);
 
        return 0;
index dff9eb4637c52480cf2ea33ad1577fd64dd5430f..c8f745ea8a348ce5b7fd0bca77ad19c1385b835e 100644 (file)
@@ -174,7 +174,7 @@ static int ipneigh_modify(int cmd, int flags, int argc, char **argv)
                return -1;
        }
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                exit(2);
 
        return 0;
@@ -391,7 +391,7 @@ int do_show_or_flush(int argc, char **argv, int flush)
                                exit(1);
                        }
                        filter.flushed = 0;
-                       if (rtnl_dump_filter(&rth, print_neigh, stdout, NULL, NULL) < 0) {
+                       if (rtnl_dump_filter(&rth, print_neigh, stdout) < 0) {
                                fprintf(stderr, "Flush terminated\n");
                                exit(1);
                        }
@@ -423,7 +423,7 @@ int do_show_or_flush(int argc, char **argv, int flush)
                exit(1);
        }
 
-       if (rtnl_dump_filter(&rth, print_neigh, stdout, NULL, NULL) < 0) {
+       if (rtnl_dump_filter(&rth, print_neigh, stdout) < 0) {
                fprintf(stderr, "Dump terminated\n");
                exit(1);
        }
index 141ad425e534f4d4956149e7962e0f6f71f06dfc..b00d3dca106ff1360ebdf2adf193b6bcdbb63f30 100644 (file)
@@ -313,7 +313,7 @@ static int ipntable_modify(int cmd, int flags, int argc, char **argv)
                          RTA_PAYLOAD(parms_rta));
        }
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                exit(2);
 
        return 0;
@@ -625,7 +625,7 @@ static int ipntable_show(int argc, char **argv)
                exit(1);
        }
 
-       if (rtnl_dump_filter(&rth, print_ntable, stdout, NULL, NULL) < 0) {
+       if (rtnl_dump_filter(&rth, print_ntable, stdout) < 0) {
                fprintf(stderr, "Dump terminated\n");
                exit(1);
        }
index 15b36e8d8873a69b3c8685ac28a02fe406e643d1..c97f9794840ffb098eefcc5e03e6d35d2f8586c4 100644 (file)
@@ -1011,7 +1011,7 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
        if (req.r.rtm_family == AF_UNSPEC)
                req.r.rtm_family = AF_INET;
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                exit(2);
 
        return 0;
@@ -1289,7 +1289,7 @@ static int iproute_list_flush_or_save(int argc, char **argv, int action)
                                exit(1);
                        }
                        filter.flushed = 0;
-                       if (rtnl_dump_filter(&rth, filter_fn, stdout, NULL, NULL) < 0) {
+                       if (rtnl_dump_filter(&rth, filter_fn, stdout) < 0) {
                                fprintf(stderr, "Flush terminated\n");
                                exit(1);
                        }
@@ -1332,7 +1332,7 @@ static int iproute_list_flush_or_save(int argc, char **argv, int action)
                }
        }
 
-       if (rtnl_dump_filter(&rth, filter_fn, stdout, NULL, NULL) < 0) {
+       if (rtnl_dump_filter(&rth, filter_fn, stdout) < 0) {
                fprintf(stderr, "Dump terminated\n");
                exit(1);
        }
@@ -1453,7 +1453,7 @@ int iproute_get(int argc, char **argv)
        if (req.r.rtm_family == AF_UNSPEC)
                req.r.rtm_family = AF_INET;
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, &req.n, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, &req.n) < 0)
                exit(2);
 
        if (connected && !from_ok) {
@@ -1494,7 +1494,7 @@ int iproute_get(int argc, char **argv)
                req.n.nlmsg_flags = NLM_F_REQUEST;
                req.n.nlmsg_type = RTM_GETROUTE;
 
-               if (rtnl_talk(&rth, &req.n, 0, 0, &req.n, NULL, NULL) < 0)
+               if (rtnl_talk(&rth, &req.n, 0, 0, &req.n) < 0)
                        exit(2);
        }
 
@@ -1514,7 +1514,7 @@ int restore_handler(const struct sockaddr_nl *nl, struct nlmsghdr *n, void *arg)
 
        ll_init_map(&rth);
 
-       ret = rtnl_talk(&rth, n, 0, 0, n, NULL, NULL);
+       ret = rtnl_talk(&rth, n, 0, 0, n);
        if ((ret < 0) && (errno == EEXIST))
                ret = 0;
 
index 9318d8cad087522a0184846c247b030c01d8ce46..f983731fc12960ca4fad8132f1de4e92eeda1341 100644 (file)
@@ -212,7 +212,7 @@ static int iprule_list(int argc, char **argv)
                return 1;
        }
 
-       if (rtnl_dump_filter(&rth, print_rule, stdout, NULL, NULL) < 0) {
+       if (rtnl_dump_filter(&rth, print_rule, stdout) < 0) {
                fprintf(stderr, "Dump terminated\n");
                return 1;
        }
@@ -355,7 +355,7 @@ static int iprule_modify(int cmd, int argc, char **argv)
        if (!table_ok && cmd == RTM_NEWRULE)
                req.r.rtm_table = RT_TABLE_MAIN;
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                return 2;
 
        return 0;
@@ -382,7 +382,7 @@ static int flush_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *a
                if (rtnl_open(&rth2, 0) < 0)
                        return -1;
 
-               if (rtnl_talk(&rth2, n, 0, 0, NULL, NULL, NULL) < 0)
+               if (rtnl_talk(&rth2, n, 0, 0, NULL) < 0)
                        return -2;
 
                rtnl_close(&rth2);
@@ -408,7 +408,7 @@ static int iprule_flush(int argc, char **argv)
                return 1;
        }
 
-       if (rtnl_dump_filter(&rth, flush_rule, NULL, NULL, NULL) < 0) {
+       if (rtnl_dump_filter(&rth, flush_rule, NULL) < 0) {
                fprintf(stderr, "Flush terminated\n");
                return 1;
        }
index 62baaf484eea5b8384babd3d2d47336af144735f..c783203bebadfeb6cc2a0cb74c58911259146629 100644 (file)
@@ -72,7 +72,7 @@ static int gre_parse_opt(struct link_util *lu, int argc, char **argv,
                req.i.ifi_family = preferred_family;
                req.i.ifi_index = ifi->ifi_index;
 
-               if (rtnl_talk(&rth, &req.n, 0, 0, &req.n, NULL, NULL) < 0) {
+               if (rtnl_talk(&rth, &req.n, 0, 0, &req.n) < 0) {
 get_failed:
                        fprintf(stderr,
                                "Failed to get existing tunnel info.\n");
index 7869b32c1a8ff9e5190c7daab028642c7609eae7..c1416a0bdf0b7b55c0f54ea1e55b8f9bbe0e4efd 100644 (file)
@@ -163,7 +163,7 @@ main(int argc, char **argv)
 
        write_stamp(fp);
 
-       if (rtnl_dump_filter(&rth, dump_msg, fp, NULL, NULL) < 0) {
+       if (rtnl_dump_filter(&rth, dump_msg, fp) < 0) {
                fprintf(stderr, "Dump terminated\n");
                return 1;
        }
index 2a14903b61a77eda010da50cec0136ae1bb3170c..8e3aec503b0aeb4d3f878a76c137c7b634340584 100644 (file)
@@ -393,7 +393,7 @@ static int xfrm_policy_modify(int cmd, unsigned flags, int argc, char **argv)
        if (req.xpinfo.sel.family == AF_UNSPEC)
                req.xpinfo.sel.family = AF_INET;
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                exit(2);
 
        rtnl_close(&rth);
@@ -670,7 +670,7 @@ static int xfrm_policy_get_or_delete(int argc, char **argv, int delete,
                          (void *)&ctx, ctx.sctx.len);
        }
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, res_nlbuf, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, res_nlbuf) < 0)
                exit(2);
 
        rtnl_close(&rth);
@@ -859,7 +859,7 @@ static int xfrm_policy_list_or_deleteall(int argc, char **argv, int deleteall)
                                exit(1);
                        }
 
-                       if (rtnl_dump_filter(&rth, xfrm_policy_keep, &xb, NULL, NULL) < 0) {
+                       if (rtnl_dump_filter(&rth, xfrm_policy_keep, &xb) < 0) {
                                fprintf(stderr, "Delete-all terminated\n");
                                exit(1);
                        }
@@ -885,7 +885,7 @@ static int xfrm_policy_list_or_deleteall(int argc, char **argv, int deleteall)
                        exit(1);
                }
 
-               if (rtnl_dump_filter(&rth, xfrm_policy_print, stdout, NULL, NULL) < 0) {
+               if (rtnl_dump_filter(&rth, xfrm_policy_print, stdout) < 0) {
                        fprintf(stderr, "Dump terminated\n");
                        exit(1);
                }
@@ -975,7 +975,7 @@ static int xfrm_spd_getinfo(int argc, char **argv)
        if (rtnl_open_byproto(&rth, 0, NETLINK_XFRM) < 0)
                exit(1);
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, &req.n, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, &req.n) < 0)
                exit(2);
 
        print_spdinfo(&req.n, (void*)stdout);
@@ -1027,7 +1027,7 @@ static int xfrm_policy_flush(int argc, char **argv)
        if (show_stats > 1)
                fprintf(stderr, "Flush policy\n");
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                exit(2);
 
        rtnl_close(&rth);
index a76be47d568dba6ba1dd2306553b3d518205f800..0d98e78729da01595787c166dcf5df0c00de6d98 100644 (file)
@@ -544,7 +544,7 @@ static int xfrm_state_modify(int cmd, unsigned flags, int argc, char **argv)
        if (req.xsinfo.family == AF_UNSPEC)
                req.xsinfo.family = AF_INET;
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                exit(2);
 
        rtnl_close(&rth);
@@ -681,7 +681,7 @@ static int xfrm_state_allocspi(int argc, char **argv)
                req.xspi.info.family = AF_INET;
 
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, res_n, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, res_n) < 0)
                exit(2);
 
        if (xfrm_state_print(NULL, res_n, (void*)stdout) < 0) {
@@ -871,7 +871,7 @@ static int xfrm_state_get_or_delete(int argc, char **argv, int delete)
                req.xsid.family = AF_INET;
 
        if (delete) {
-               if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+               if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                        exit(2);
        } else {
                char buf[NLMSG_BUF_SIZE];
@@ -879,7 +879,7 @@ static int xfrm_state_get_or_delete(int argc, char **argv, int delete)
 
                memset(buf, 0, sizeof(buf));
 
-               if (rtnl_talk(&rth, &req.n, 0, 0, res_n, NULL, NULL) < 0)
+               if (rtnl_talk(&rth, &req.n, 0, 0, res_n) < 0)
                        exit(2);
 
                if (xfrm_state_print(NULL, res_n, (void*)stdout) < 0) {
@@ -1015,7 +1015,7 @@ static int xfrm_state_list_or_deleteall(int argc, char **argv, int deleteall)
                                exit(1);
                        }
 
-                       if (rtnl_dump_filter(&rth, xfrm_state_keep, &xb, NULL, NULL) < 0) {
+                       if (rtnl_dump_filter(&rth, xfrm_state_keep, &xb) < 0) {
                                fprintf(stderr, "Delete-all terminated\n");
                                exit(1);
                        }
@@ -1042,7 +1042,7 @@ static int xfrm_state_list_or_deleteall(int argc, char **argv, int deleteall)
                        exit(1);
                }
 
-               if (rtnl_dump_filter(&rth, xfrm_state_print, stdout, NULL, NULL) < 0) {
+               if (rtnl_dump_filter(&rth, xfrm_state_print, stdout) < 0) {
                        fprintf(stderr, "Dump terminated\n");
                        exit(1);
                }
@@ -1120,7 +1120,7 @@ static int xfrm_sad_getinfo(int argc, char **argv)
        if (rtnl_open_byproto(&rth, 0, NETLINK_XFRM) < 0)
                exit(1);
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, &req.n, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, &req.n) < 0)
                exit(2);
 
        print_sadinfo(&req.n, (void*)stdout);
@@ -1174,7 +1174,7 @@ static int xfrm_state_flush(int argc, char **argv)
                fprintf(stderr, "Flush state proto=%s\n",
                        strxf_xfrmproto(req.xsf.proto));
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                exit(2);
 
        rtnl_close(&rth);
index f7413b60f2b6a7272dbdafd4ab83d1422f9bb9e5..c8fc4ef04c28fc49cf7c4215743df09f659d81ad 100644 (file)
@@ -214,15 +214,8 @@ int rtnl_dump_filter_l(struct rtnl_handle *rth,
 
                                if (nladdr.nl_pid != 0 ||
                                    h->nlmsg_pid != rth->local.nl_pid ||
-                                   h->nlmsg_seq != rth->dump) {
-                                       if (a->junk) {
-                                               err = a->junk(&nladdr, h,
-                                                             a->arg2);
-                                               if (err < 0)
-                                                       return err;
-                                       }
+                                   h->nlmsg_seq != rth->dump)
                                        goto skip_it;
-                               }
 
                                if (h->nlmsg_type == NLMSG_DONE) {
                                        found_done = 1;
@@ -264,22 +257,18 @@ skip_it:
 
 int rtnl_dump_filter(struct rtnl_handle *rth,
                     rtnl_filter_t filter,
-                    void *arg1,
-                    rtnl_filter_t junk,
-                    void *arg2)
+                    void *arg1)
 {
        const struct rtnl_dump_filter_arg a[2] = {
-               { .filter = filter, .arg1 = arg1, .junk = junk, .arg2 = arg2 },
-               { .filter = NULL,   .arg1 = NULL, .junk = NULL, .arg2 = NULL }
+               { .filter = filter, .arg1 = arg1, },
+               { .filter = NULL,   .arg1 = NULL, },
        };
 
        return rtnl_dump_filter_l(rth, a);
 }
 
 int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
-             unsigned groups, struct nlmsghdr *answer,
-             rtnl_filter_t junk,
-             void *jarg)
+             unsigned groups, struct nlmsghdr *answer)
 {
        int status;
        unsigned seq;
@@ -338,11 +327,10 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
                        exit(1);
                }
                for (h = (struct nlmsghdr*)buf; status >= sizeof(*h); ) {
-                       int err;
                        int len = h->nlmsg_len;
                        int l = len - sizeof(*h);
 
-                       if (l<0 || len>status) {
+                       if (l < 0 || len>status) {
                                if (msg.msg_flags & MSG_TRUNC) {
                                        fprintf(stderr, "Truncated message\n");
                                        return -1;
@@ -354,11 +342,6 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
                        if (nladdr.nl_pid != peer ||
                            h->nlmsg_pid != rtnl->local.nl_pid ||
                            h->nlmsg_seq != seq) {
-                               if (junk) {
-                                       err = junk(&nladdr, h, jarg);
-                                       if (err < 0)
-                                               return err;
-                               }
                                /* Don't forget to skip that message. */
                                status -= NLMSG_ALIGN(len);
                                h = (struct nlmsghdr*)((char*)h + NLMSG_ALIGN(len));
index d3cde2259485a9fed51d3d239e53239fff639f9e..1ca781e9130877613fd4c0a0239790c5af59504e 100644 (file)
@@ -204,7 +204,7 @@ int ll_init_map(struct rtnl_handle *rth)
                exit(1);
        }
 
-       if (rtnl_dump_filter(rth, ll_remember_index, NULL, NULL, NULL) < 0) {
+       if (rtnl_dump_filter(rth, ll_remember_index, NULL) < 0) {
                fprintf(stderr, "Dump terminated\n");
                exit(1);
        }
index 7d33f5e36ffa8fc83d16eb9462efb600846f0f0b..e7fbaa8d4e97b966dda2dfc81ae3ca4e760642dd 100644 (file)
@@ -128,7 +128,7 @@ void load_info(void)
                exit(1);
        }
 
-       if (rtnl_dump_filter(&rth, get_nlmsg, NULL, NULL, NULL) < 0) {
+       if (rtnl_dump_filter(&rth, get_nlmsg, NULL) < 0) {
                fprintf(stderr, "Dump terminated\n");
                exit(1);
        }
index 6464b2ed064bb3234853180df5d15087a6cb156b..1fe24314ed1e610397f6dc2dc4bfb92cc3a41b10 100644 (file)
@@ -451,7 +451,7 @@ int tc_action_gd(int cmd, unsigned flags, int *argc_p, char ***argv_p)
        if (cmd == RTM_GETACTION)
                ans = &req.n;
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, ans, NULL, NULL) < 0) {
+       if (rtnl_talk(&rth, &req.n, 0, 0, ans) < 0) {
                fprintf(stderr, "We have an error talking to the kernel\n");
                return 1;
        }
@@ -496,7 +496,7 @@ int tc_action_modify(int cmd, unsigned flags, int *argc_p, char ***argv_p)
        }
        tail->rta_len = (void *) NLMSG_TAIL(&req.n) - (void *) tail;
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0) {
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0) {
                fprintf(stderr, "We have an error talking to the kernel\n");
                ret = -1;
        }
@@ -558,7 +558,7 @@ int tc_act_list_or_flush(int argc, char **argv, int event)
                        perror("Cannot send dump request");
                        return 1;
                }
-               ret = rtnl_dump_filter(&rth, print_action, stdout, NULL, NULL);
+               ret = rtnl_dump_filter(&rth, print_action, stdout);
        }
 
        if (event == RTM_DELACTION) {
@@ -566,7 +566,7 @@ int tc_act_list_or_flush(int argc, char **argv, int event)
                req.n.nlmsg_type = RTM_DELACTION;
                req.n.nlmsg_flags |= NLM_F_ROOT;
                req.n.nlmsg_flags |= NLM_F_REQUEST;
-               if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0) {
+               if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0) {
                        fprintf(stderr, "We have an error flushing\n");
                        return 1;
                }
index 9d4eea5c1c8f297c3f553091bbf12d05f21115e7..3a1a0ac0060beda3a04e0383da59d64b627f3e4a 100644 (file)
@@ -138,7 +138,7 @@ int tc_class_modify(int cmd, unsigned flags, int argc, char **argv)
                }
        }
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                return 2;
 
        return 0;
@@ -298,7 +298,7 @@ int tc_class_list(int argc, char **argv)
                return 1;
        }
 
-       if (rtnl_dump_filter(&rth, print_class, stdout, NULL, NULL) < 0) {
+       if (rtnl_dump_filter(&rth, print_class, stdout) < 0) {
                fprintf(stderr, "Dump terminated\n");
                return 1;
        }
index 4e55812774742c75a43183a852a107d28fc1de85..d4b0b671b2bc288a1307b165e31e29e5dd051941 100644 (file)
@@ -167,7 +167,7 @@ int tc_filter_modify(int cmd, unsigned flags, int argc, char **argv)
                }
        }
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0) {
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0) {
                fprintf(stderr, "We have an error talking to the kernel\n");
                return 2;
        }
@@ -341,7 +341,7 @@ int tc_filter_list(int argc, char **argv)
                return 1;
        }
 
-       if (rtnl_dump_filter(&rth, print_filter, stdout, NULL, NULL) < 0) {
+       if (rtnl_dump_filter(&rth, print_filter, stdout) < 0) {
                fprintf(stderr, "Dump terminated\n");
                return 1;
        }
index c7f2988b0eaedf883e90585d7a0ae31f393cfb8a..0822e63e22d4eeedda8024342b3d2d724a7f80cb 100644 (file)
@@ -186,7 +186,7 @@ int tc_qdisc_modify(int cmd, unsigned flags, int argc, char **argv)
                req.t.tcm_ifindex = idx;
        }
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
                return 2;
 
        return 0;
@@ -323,7 +323,7 @@ int tc_qdisc_list(int argc, char **argv)
                return 1;
        }
 
-       if (rtnl_dump_filter(&rth, print_qdisc, stdout, NULL, NULL) < 0) {
+       if (rtnl_dump_filter(&rth, print_qdisc, stdout) < 0) {
                fprintf(stderr, "Dump terminated\n");
                return 1;
        }